|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Backpack\CRUD\app\Console\Commands\Upgrade\v7; |
|
4
|
|
|
|
|
5
|
|
|
use Backpack\CRUD\app\Console\Commands\Upgrade\UpgradeCommand; |
|
6
|
|
|
use Backpack\CRUD\app\Console\Commands\Upgrade\UpgradeConfigInterface; |
|
7
|
|
|
use Backpack\CRUD\app\Console\Commands\Upgrade\UpgradeConfigSummaryInterface; |
|
8
|
|
|
use Backpack\CRUD\app\Console\Commands\Upgrade\v7\Steps as Step; |
|
9
|
|
|
|
|
10
|
|
|
class UpgradeCommandConfig implements UpgradeConfigInterface, UpgradeConfigSummaryInterface |
|
11
|
|
|
{ |
|
12
|
|
|
public function steps(): array |
|
13
|
|
|
{ |
|
14
|
|
|
return [ |
|
15
|
|
|
Step\EnsureLaravelVersionStep::class, |
|
16
|
|
|
Step\EnsureBackpackCrudRequirementStep::class, |
|
17
|
|
|
Step\EnsureMinimumStabilityStep::class, |
|
18
|
|
|
Step\EnsureFirstPartyAddonsAreCompatibleStep::class, |
|
19
|
|
|
Step\CheckOperationConfigFilesStep::class, |
|
20
|
|
|
Step\CheckThemeTablerConfigStep::class, |
|
21
|
|
|
Step\DetectDeprecatedWysiwygUsageStep::class, |
|
22
|
|
|
Step\DetectEditorAddonRequirementsStep::class, |
|
23
|
|
|
Step\CheckShowOperationViewPublishedStep::class, |
|
24
|
|
|
Step\CheckShowOperationComponentConfigStep::class, |
|
25
|
|
|
Step\CheckFileManagerPublishedViewsStep::class, |
|
26
|
|
|
Step\CheckListOperationViewPublishedStep::class, |
|
27
|
|
|
]; |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
public function addons(): array |
|
31
|
|
|
{ |
|
32
|
|
|
return [ |
|
33
|
|
|
'backpack/crud' => self::backpackCrudRequirement(), |
|
34
|
|
|
'backpack/filemanager' => 'dev-next', |
|
35
|
|
|
'backpack/theme-coreuiv2' => 'dev-next', |
|
36
|
|
|
'backpack/theme-coreuiv4' => 'dev-next', |
|
37
|
|
|
'backpack/theme-tabler' => 'dev-next', |
|
38
|
|
|
'backpack/logmanager' => 'dev-next', |
|
39
|
|
|
'backpack/settings' => 'dev-next', |
|
40
|
|
|
'backpack/newscrud' => 'dev-next', |
|
41
|
|
|
'backpack/permissionmanager' => 'dev-next', |
|
42
|
|
|
'backpack/pagemanager' => 'dev-next', |
|
43
|
|
|
'backpack/menucrud' => 'dev-next', |
|
44
|
|
|
'backpack/backupmanager' => 'dev-next', |
|
45
|
|
|
'backpack/editable-columns' => 'dev-next', |
|
46
|
|
|
'backpack/revise-operation' => 'dev-next', |
|
47
|
|
|
'backpack/medialibrary-uploaders' => 'dev-next', |
|
48
|
|
|
'backpack/devtools' => 'dev-next', |
|
49
|
|
|
'backpack/generators' => 'dev-next', |
|
50
|
|
|
'backpack/activity-log' => 'dev-next', |
|
51
|
|
|
'backpack/calendar-operation' => 'dev-next', |
|
52
|
|
|
'backpack/language-switcher' => 'dev-next', |
|
53
|
|
|
'backpack/pan-panel' => 'dev-next', |
|
54
|
|
|
'backpack/pro' => '^3.0.0-alpha', |
|
55
|
|
|
'backpack/translation-manager' => 'dev-next', |
|
56
|
|
|
'backpack/ckeditor-field' => 'dev-next', |
|
57
|
|
|
'backpack/tinymce-field' => 'dev-next', |
|
58
|
|
|
]; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
public function upgradeCommandDescription(): ?callable |
|
62
|
|
|
{ |
|
63
|
|
|
return function (UpgradeCommand $command): void { |
|
64
|
|
|
$command->note( |
|
65
|
|
|
'These checks will highlight anything you need to tackle before enjoying the new release.'.PHP_EOL. |
|
66
|
|
|
' Full upgrade instructions: <fg=cyan>https://backpackforlaravel.com/docs/7.x/upgrade-guide</>', |
|
67
|
|
|
'green', |
|
68
|
|
|
'green' |
|
69
|
|
|
); |
|
70
|
|
|
|
|
71
|
|
|
$command->note( |
|
72
|
|
|
'Before you start, make sure you have a fresh <fg=red>FULL BACKUP</> of your project and database stored safely.'.PHP_EOL. |
|
73
|
|
|
' Run <fg=magenta>backpack:upgrade --version=7</> alongside the guide so you do not miss any manual steps.', |
|
74
|
|
|
'yellow', |
|
75
|
|
|
'yellow' |
|
76
|
|
|
); |
|
77
|
|
|
}; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
public function upgradeCommandSummary(): ?string |
|
81
|
|
|
{ |
|
82
|
|
|
return 'Run the automated checks, while following the upgrade guide: <fg=cyan>https://backpackforlaravel.com/docs/7.x/upgrade-guide</>'; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
public static function backpackCrudRequirement(): string |
|
86
|
|
|
{ |
|
87
|
|
|
return '^7.0.0-beta'; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
public static function postUpgradeCommands(): array |
|
91
|
|
|
{ |
|
92
|
|
|
return [ |
|
93
|
|
|
'php artisan basset:clear', |
|
94
|
|
|
'php artisan config:clear', |
|
95
|
|
|
'php artisan cache:clear', |
|
96
|
|
|
'php artisan view:clear', |
|
97
|
|
|
]; |
|
98
|
|
|
} |
|
99
|
|
|
} |
|
100
|
|
|
|