Source of file CreatePublicFolder.php
Size: 1,493 Bytes - Last Modified: 2020-07-03T12:08:09+00:00
/var/www/docs.ssmods.com/process/src/src/Tasks/IndividualTasks/CreatePublicFolder.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 | <?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 CreatePublicFolder extends Task { protected $taskStep = 's10'; protected $publicFolderName = 'public'; public function getTitle() { return 'Create a public folder to match SS4 folder structure'; } public function getDescription() { return ' For projects only, we create a public folder: ' . $this->mu()->getWebRootDirLocation() . '/public'; } /** * [runActualTask description] * @param array $params not currently used for this task */ public function runActualTask($params = []) { if ($this->mu()->getIsProjectUpgrade()) { $newFolder = $this->mu()->getWebRootDirLocation() . '/' . $this->publicFolderName; FileSystemFixes::inst($this->mu()) ->mkDir($newFolder); $this->mu()->execMe( $newFolder, 'echo \'hello world\' >> hello-world.html', 'adding public test file', false ); } } protected function hasCommitAndPush() { return $this->mu()->getIsProjectUpgrade(); } } |