Source of file AddLicenceToProjectForRecomposeTask.php
Size: 1,455 Bytes - Last Modified: 2020-07-03T12:08:09+00:00
/var/www/docs.ssmods.com/process/src/src/Tasks/IndividualTasks/AddLicenceToProjectForRecomposeTask.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 | <?php namespace Sunnysideup\UpgradeToSilverstripe4\Tasks\IndividualTasks; use Sunnysideup\UpgradeToSilverstripe4\Tasks\Helpers\ComposerJsonFixes; use Sunnysideup\UpgradeToSilverstripe4\Tasks\Task; /** * Replaces the composer type from silverstripe-module to silverstripe-vendormodule in line with SS4 standards. * This means your module will be installed in the vendor folder after this upgrade. */ class AddLicenceToProjectForRecomposeTask extends Task { protected $taskStep = 's50'; public function getTitle() { return 'Add license to project to ensure recompose works.'; } public function getDescription() { return ' Adds the license = proprietary to the composer file to ensure the recompose task works.'; } public function runActualTask($params = []) { if ($this->mu()->getIsProjectUpgrade()) { $comment = 'add license'; $command = 'if(! isset($data["license"])) { ' . ' $data["license"] = proprietary";' . '}'; ComposerJsonFixes::inst($this->mu())->UpdateJSONViaCommandLine( $this->mu()->getGitRootDir(), $command, $comment ); $this->setCommitMessage('MAJOR: ' . $this->getTitle()); } } protected function hasCommitAndPush() { return $this->mu()->getIsModuleUpgrade() ? false : true; } } |