Source of file MoveCodeToSRC.php
Size: 1,190 Bytes - Last Modified: 2020-07-03T12:08:09+00:00
/var/www/docs.ssmods.com/process/src/src/Tasks/IndividualTasks/MoveCodeToSRC.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | <?php namespace Sunnysideup\UpgradeToSilverstripe4\Tasks\IndividualTasks; use Sunnysideup\UpgradeToSilverstripe4\Api\FileSystemFixes; use Sunnysideup\UpgradeToSilverstripe4\Tasks\Task; /** * This task adds a legacy branch to the git repo of the original to act as a backup/legacy version for * holding a version of the module before it was changed */ class MoveCodeToSRC extends Task { protected $taskStep = 's30'; public function getTitle() { return 'Move code to src folder'; } public function getDescription() { return ' Move the code folder to the src folder to match PSR requirements.'; } /** * [runActualTask description] * @param array $params not currently used for this task */ public function runActualTask($params = []) { foreach ($this->mu()->getExistingModuleDirLocations() as $moduleDir) { $old = '/code/'; $new = '/src/'; $fixer = FileSystemFixes::inst($this->mu()); $fixer->moveFolderOrFile($moduleDir . $old, $moduleDir . $new); } } protected function hasCommitAndPush() { return true; } } |