Total Complexity | 6 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | class ChangeEnvironment extends Task |
||
14 | { |
||
15 | protected $taskStep = 's20'; |
||
16 | |||
17 | protected $rootDirForCommand = ''; |
||
18 | |||
19 | protected $param1 = ''; |
||
20 | |||
21 | protected $param2 = ''; |
||
22 | |||
23 | protected $settings = ''; |
||
24 | |||
25 | public function getTitle() |
||
26 | { |
||
27 | return 'Change Environment File'; |
||
28 | } |
||
29 | |||
30 | public function getDescription() |
||
33 | Runs the silverstripe/upgrade task "environment". See: |
||
34 | https://github.com/silverstripe/silverstripe-upgrader#environment. |
||
35 | You can use this command to migrate a SilverStripe 3 _ss_environment.php |
||
36 | file to the Silverstripe 4 .env format.'; |
||
37 | } |
||
38 | |||
39 | public function runActualTask($params = []): ?string |
||
40 | { |
||
41 | if ($this->mu()->getIsModuleUpgrade()) { |
||
42 | //do nothing |
||
43 | } else { |
||
44 | $this->runSilverstripeUpgradeTask( |
||
45 | 'environment', |
||
46 | $this->param1, |
||
47 | $this->param2, |
||
48 | $this->rootDirForCommand, |
||
49 | $this->settings |
||
50 | ); |
||
51 | $this->setCommitMessage('API: changing environment file(s)'); |
||
52 | } |
||
53 | return null; |
||
54 | } |
||
55 | |||
56 | protected function hasCommitAndPush() |
||
62 | } |
||
63 | } |
||
64 |