|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Sunnysideup\UpgradeToSilverstripe4\Tasks\IndividualTasks; |
|
4
|
|
|
|
|
5
|
|
|
use Sunnysideup\UpgradeToSilverstripe4\Tasks\Task; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Runs the silverstripe/upgrade task "reorganise". See: |
|
9
|
|
|
* https://github.com/silverstripe/silverstripe-upgrader#reorganise |
|
10
|
|
|
* You can use this command to reorganise your folder structure to |
|
11
|
|
|
* conform to the new structure introduced with SilverStripe 4.1. |
|
12
|
|
|
* Your mysite folder will be renamed to app and your code folder will be rename to src. |
|
13
|
|
|
*/ |
|
14
|
|
|
class Reorganise extends Task |
|
15
|
|
|
{ |
|
16
|
|
|
protected $taskStep = 's50'; |
|
17
|
|
|
|
|
18
|
|
|
protected $param1 = ''; |
|
19
|
|
|
|
|
20
|
|
|
protected $param2 = ''; |
|
21
|
|
|
|
|
22
|
|
|
protected $rootDirForCommand = ''; |
|
23
|
|
|
|
|
24
|
|
|
protected $settings = ''; |
|
25
|
|
|
|
|
26
|
|
|
public function getTitle() |
|
27
|
|
|
{ |
|
28
|
|
|
return 'move mysite/code folder to app/src'; |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
public function getDescription() |
|
32
|
|
|
{ |
|
33
|
|
|
return ' |
|
34
|
|
|
Runs the silverstripe/upgrade task "reorganise". See: |
|
35
|
|
|
https://github.com/silverstripe/silverstripe-upgrader#reorganise |
|
36
|
|
|
You can use this command to reorganise your folder structure to |
|
37
|
|
|
conform to the new structure introduced with SilverStripe 4.1. |
|
38
|
|
|
Your mysite folder will be renamed to app and your code folder will be renamed to src. |
|
39
|
|
|
'; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function runActualTask($params = []) |
|
43
|
|
|
{ |
|
44
|
|
|
if ($this->mu()->getIsModuleUpgrade()) { |
|
|
|
|
|
|
45
|
|
|
} else { |
|
46
|
|
|
$this->runSilverstripeUpgradeTask( |
|
47
|
|
|
'reorganise', |
|
48
|
|
|
$this->param1, |
|
49
|
|
|
$this->param2, |
|
50
|
|
|
$this->rootDirForCommand, |
|
51
|
|
|
$this->settings |
|
52
|
|
|
); |
|
53
|
|
|
$this->setCommitMessage('MAJOR: re-organising files'); |
|
54
|
|
|
} |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
protected function hasCommitAndPush() |
|
58
|
|
|
{ |
|
59
|
|
|
if ($this->mu()->getIsModuleUpgrade()) { |
|
60
|
|
|
return false; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
return true; |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|