From 8ae83cbabd8622c6c4d40c4c5092d32ebf848ec8 Mon Sep 17 00:00:00 2001 From: Ismael Ambrosi Date: Fri, 5 Dec 2014 02:40:30 -0200 Subject: [PATCH 1/2] Use instanceof instead of method is_a Since is_a is a method, it is significantly slower than using instanceof Following is a perfomance comparison: http://micro-optimization.com/is_a-vs-instanceof --- Mage/Task/Factory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/Task/Factory.php b/Mage/Task/Factory.php index 912026f..57dff35 100644 --- a/Mage/Task/Factory.php +++ b/Mage/Task/Factory.php @@ -59,7 +59,7 @@ class Factory $instance = new $className($taskConfig, $inRollback, $stage, $taskParameters); - if (!is_a($instance, 'Mage\Task\AbstractTask')) { + if (!($instance instanceof AbstractTask)) { throw new Exception('The Task ' . $taskName . ' must be an instance of Mage\Task\AbstractTask.'); } From 3b70a8a3c1e3a8b894bcd118e61df9302c574621 Mon Sep 17 00:00:00 2001 From: Dmitry Motylev Date: Tue, 23 Dec 2014 17:34:48 +0000 Subject: [PATCH 2/2] fix: DeployCommand does not fail when no one "Post-Deployment Tasks" failed and failed "Deployment Task" exist --- Mage/Command/BuiltIn/DeployCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Mage/Command/BuiltIn/DeployCommand.php b/Mage/Command/BuiltIn/DeployCommand.php index 943a630..f53eac0 100644 --- a/Mage/Command/BuiltIn/DeployCommand.php +++ b/Mage/Command/BuiltIn/DeployCommand.php @@ -202,7 +202,11 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment if (self::$failedTasks === 0) { $exitCode = 0; } - + + if (self::$deployStatus === self::FAILED) { + $exitCode = 1; + } + return $exitCode; }