From 4e01cc3517296346a24fdf3ece3bd97ca974cb24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Thu, 12 Jun 2014 16:17:31 -0300 Subject: [PATCH] Tweaks and fixes. --- .gitignore | 1 + Mage/Command/BuiltIn/DeployCommand.php | 5 ++++- Mage/Command/BuiltIn/ReleasesCommand.php | 14 +++++++------- Mage/Task/BuiltIn/Ioncube/EncryptTask.php | 5 +++-- Mage/Task/Factory.php | 5 +++-- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index cc83d69..458da2e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .settings/* .project .buildpath +.idea # OS generated files # // GitHub Recommendation ###################### diff --git a/Mage/Command/BuiltIn/DeployCommand.php b/Mage/Command/BuiltIn/DeployCommand.php index 916d546..84720f5 100644 --- a/Mage/Command/BuiltIn/DeployCommand.php +++ b/Mage/Command/BuiltIn/DeployCommand.php @@ -449,7 +449,7 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment $runTask = true; if (($task instanceOf SkipOnOverride) && $this->getConfig()->getParameter('overrideRelease', false)) { - $runTask == false; + $runTask = false; } $result = false; @@ -516,6 +516,7 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment /** * Send Email Notification if enabled * @param boolean $result + * @return boolean */ protected function sendNotification($result) { @@ -534,6 +535,8 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment ->setLogFile(Console::getLogFile()) ->setEnvironment($this->getConfig()->getEnvironment()) ->send($result); + + return true; } } diff --git a/Mage/Command/BuiltIn/ReleasesCommand.php b/Mage/Command/BuiltIn/ReleasesCommand.php index 34d82ad..f20e052 100644 --- a/Mage/Command/BuiltIn/ReleasesCommand.php +++ b/Mage/Command/BuiltIn/ReleasesCommand.php @@ -32,7 +32,7 @@ class ReleasesCommand extends AbstractCommand implements RequiresEnvironment $lockFile = '.mage/' . $this->getConfig()->getEnvironment() . '.lock'; if (file_exists($lockFile) && ($subcommand == 'rollback')) { Console::output('This environment is locked!', 1, 2); - return; + return null; } // Run Tasks for Deployment @@ -47,17 +47,17 @@ class ReleasesCommand extends AbstractCommand implements RequiresEnvironment switch ($subcommand) { case 'list': - $task = Factory::get('releases/list', $this->getConfig()); - $task->init(); + $task = Factory::get('releases/list', $this->getConfig()); + $task->init(); $result = $task->run(); break; case 'rollback': - $releaseId = $this->getConfig()->getParameter('release', ''); - $task = Factory::get('releases/rollback', $this->getConfig()); + $releaseId = $this->getConfig()->getParameter('release', ''); + $task = Factory::get('releases/rollback', $this->getConfig()); $task->init(); - $task->setRelease($releaseId); - $result = $task->run(); + $task->setRelease($releaseId); + $result = $task->run(); break; } } diff --git a/Mage/Task/BuiltIn/Ioncube/EncryptTask.php b/Mage/Task/BuiltIn/Ioncube/EncryptTask.php index 9be15af..2e2b73c 100644 --- a/Mage/Task/BuiltIn/Ioncube/EncryptTask.php +++ b/Mage/Task/BuiltIn/Ioncube/EncryptTask.php @@ -316,12 +316,13 @@ class EncryptTask extends AbstractTask * Switch our current source dir to the ioncube srouce dir and create new empty dir to encrypt into * Write the IonCube project file (this is the file that controls IonCube encoder) * Run IonCube encoder - * Delete the tempory files that we created (so long as we hadn't set 'keeptemp') + * Delete the temporary files that we created (so long as we hadn't set 'keeptemp') * Return the result of the IonCube encoder * * @see \Mage\Task\AbstractTask::run() * - * @return bool + * @return boolan + * @throws \Mage\Task\ErrorWithMessageException */ public function run() { $this->switchSrcToTmp (); diff --git a/Mage/Task/Factory.php b/Mage/Task/Factory.php index 6a0b0eb..b49c1c9 100644 --- a/Mage/Task/Factory.php +++ b/Mage/Task/Factory.php @@ -28,10 +28,11 @@ class Factory * Gets an instance of a Task. * * @param string|array $taskData - * @param Mage\Config $taskConfig + * @param \Mage\Config $taskConfig * @param boolean $inRollback * @param string $stage * @return \Mage\Task\AbstractTask + * @throws \Exception|\Mage\Task\ErrorWithMessageException */ public static function get($taskData, Config $taskConfig, $inRollback = false, $stage = null) { @@ -44,7 +45,7 @@ class Factory } $instance = null; - $taskName = ucwords(str_replace('-', ' ', $taskName)); + $taskName = ucwords(str_replace('-', ' ', $taskName)); $taskName = str_replace(' ', '', $taskName); if (strpos($taskName, '/') === false) {