diff --git a/Library/Phalcon/Script.php b/Library/Phalcon/Script.php index 444494a..8988e18 100644 --- a/Library/Phalcon/Script.php +++ b/Library/Phalcon/Script.php @@ -107,8 +107,11 @@ public function getCommands() */ public function dispatch(Command $command) { - // If beforeCommand fails abort - if ($this->_eventsManager->fire('command:beforeCommand', $command) === false) { + $this->_eventsManager->collectResponses(true); + $this->_eventsManager->fire('command:beforeCommand', $command); + + // If one of beforeCommand fails, then abort + if (false !== array_search(false, $this->_eventsManager->getResponses(), true)) { return false; }