diff --git a/lib/Cake/Console/Command/AclShell.php b/lib/Cake/Console/Command/AclShell.php index 364947e7992..081eaf34980 100644 --- a/lib/Cake/Console/Command/AclShell.php +++ b/lib/Cake/Console/Command/AclShell.php @@ -82,7 +82,7 @@ public function startup() { $out .= __d('cake_console', 'Current ACL Classname: %s', $class) . "\n"; $out .= "--------------------------------------------------\n"; $this->err($out); - $this->_stop(); + return $this->_stop(); } if ($this->command) { diff --git a/lib/Cake/Console/Command/ApiShell.php b/lib/Cake/Console/Command/ApiShell.php index 584d2463806..200b67b8b0e 100644 --- a/lib/Cake/Console/Command/ApiShell.php +++ b/lib/Cake/Console/Command/ApiShell.php @@ -100,7 +100,7 @@ public function main() { if (isset($this->params['method'])) { if (!isset($parsed[$this->params['method']])) { $this->err(__d('cake_console', '%s::%s() could not be found', $class, $this->params['method'])); - $this->_stop(); + return $this->_stop(); } $method = $parsed[$this->params['method']]; $this->out($class . '::' . $method['method'] . $method['parameters']); diff --git a/lib/Cake/Console/Command/SchemaShell.php b/lib/Cake/Console/Command/SchemaShell.php index db069fa74e0..90acff90e46 100644 --- a/lib/Cake/Console/Command/SchemaShell.php +++ b/lib/Cake/Console/Command/SchemaShell.php @@ -106,11 +106,11 @@ public function view() { $File = new File($this->Schema->path . DS . $this->params['file']); if ($File->exists()) { $this->out($File->read()); - $this->_stop(); + return $this->_stop(); } else { $file = $this->Schema->path . DS . $this->params['file']; $this->err(__d('cake_console', 'Schema file (%s) could not be found.', $file)); - $this->_stop(); + return $this->_stop(); } } @@ -184,10 +184,10 @@ public function generate() { if ($this->Schema->write($content)) { $this->out(__d('cake_console', 'Schema file: %s generated', $content['file'])); - $this->_stop(); + return $this->_stop(); } else { $this->err(__d('cake_console', 'Schema file: %s generated')); - $this->_stop(); + return $this->_stop(); } } @@ -205,7 +205,7 @@ public function dump() { $Schema = $this->Schema->load(); if (!$Schema) { $this->err(__d('cake_console', 'Schema could not be loaded')); - $this->_stop(); + return $this->_stop(); } if (!empty($this->params['write'])) { if ($this->params['write'] == 1) { @@ -229,10 +229,10 @@ public function dump() { if ($File->write($contents)) { $this->out(__d('cake_console', 'SQL dump file created in %s', $File->pwd())); - $this->_stop(); + return $this->_stop(); } else { $this->err(__d('cake_console', 'SQL dump could not be created')); - $this->_stop(); + return $this->_stop(); } } $this->out($contents); @@ -290,7 +290,7 @@ protected function _loadSchema() { $this->err(__d('cake_console', 'The chosen schema could not be loaded. Attempted to load:')); $this->err(__d('cake_console', 'File: %s', $this->Schema->path . DS . $this->Schema->file)); $this->err(__d('cake_console', 'Name: %s', $this->Schema->name)); - $this->_stop(); + return $this->_stop(); } $table = null; if (isset($this->args[1])) { @@ -323,7 +323,7 @@ protected function _create(CakeSchema $Schema, $table = null) { } if (empty($drop) || empty($create)) { $this->out(__d('cake_console', 'Schema is up to date.')); - $this->_stop(); + return $this->_stop(); } $this->out("\n" . __d('cake_console', 'The following table(s) will be dropped.')); @@ -375,7 +375,7 @@ protected function _update(&$Schema, $table = null) { if (empty($contents)) { $this->out(__d('cake_console', 'Schema is up to date.')); - $this->_stop(); + return $this->_stop(); } $this->out("\n" . __d('cake_console', 'The following statements will run.')); diff --git a/lib/Cake/Console/Command/Task/ControllerTask.php b/lib/Cake/Console/Command/Task/ControllerTask.php index 4c59b498bad..cd401c487d3 100644 --- a/lib/Cake/Console/Command/Task/ControllerTask.php +++ b/lib/Cake/Console/Command/Task/ControllerTask.php @@ -289,7 +289,7 @@ public function bakeActions($controllerName, $admin = null, $wannaUseSession = t App::uses($modelImport, $plugin . 'Model'); if (!class_exists($modelImport)) { $this->err(__d('cake_console', 'You must have a model for this class to build basic methods. Please try again.')); - $this->_stop(); + return $this->_stop(); } $modelObj = ClassRegistry::init($currentModelName); diff --git a/lib/Cake/Console/Command/Task/DbConfigTask.php b/lib/Cake/Console/Command/Task/DbConfigTask.php index 55076d5fc72..d0e4572ac1d 100644 --- a/lib/Cake/Console/Command/Task/DbConfigTask.php +++ b/lib/Cake/Console/Command/Task/DbConfigTask.php @@ -77,7 +77,7 @@ public function initialize() { public function execute() { if (empty($this->args)) { $this->_interactive(); - $this->_stop(); + return $this->_stop(); } } diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index c9fece3f30f..4648c1e4770 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -207,7 +207,7 @@ public function execute() { $response = $this->in($message, null, rtrim($this->_paths[0], DS) . DS . 'Locale'); if (strtoupper($response) === 'Q') { $this->out(__d('cake_console', 'Extract Aborted')); - $this->_stop(); + return $this->_stop(); } elseif ($this->_isPathUsable($response)) { $this->_output = $response . DS; break; diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index d2232b18856..0ff10245494 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -911,7 +911,7 @@ public function getAllTables($useDbConfig = null) { } if (empty($tables)) { $this->err(__d('cake_console', 'Your database does not have any tables.')); - $this->_stop(); + return $this->_stop(); } return $tables; } @@ -933,7 +933,7 @@ public function getName($useDbConfig = null) { if ($enteredModel === 'q') { $this->out(__d('cake_console', 'Exit')); - $this->_stop(); + return $this->_stop(); } if (!$enteredModel || intval($enteredModel) > count($this->_modelNames)) { diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php index 58fa4e4e40b..cc63d084666 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -417,7 +417,7 @@ public function getPrefix() { $this->out(__d('cake_console', 'You need to enable %s in %s to use prefix routing.', 'Configure::write(\'Routing.prefixes\', array(\'admin\'))', '/app/Config/core.php')); - $this->_stop(); + return $this->_stop(); } return $admin . '_'; } diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php index 98aeb158714..38ceb5c5c56 100644 --- a/lib/Cake/Console/Command/Task/ViewTask.php +++ b/lib/Cake/Console/Command/Task/ViewTask.php @@ -267,7 +267,7 @@ protected function _loadController() { if (!class_exists($controllerClassName)) { $file = $controllerClassName . '.php'; $this->err(__d('cake_console', "The file '%s' could not be found.\nIn order to bake a view, you'll need to first create the controller.", $file)); - $this->_stop(); + return $this->_stop(); } $controllerObj = new $controllerClassName(); $controllerObj->plugin = $this->plugin; @@ -334,7 +334,7 @@ public function customAction() { $looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n'), 'y'); if (strtolower($looksGood) === 'y') { $this->bake($action, ' '); - $this->_stop(); + return $this->_stop(); } else { $this->out(__d('cake_console', 'Bake Aborted.')); } diff --git a/lib/Cake/Console/ConsoleErrorHandler.php b/lib/Cake/Console/ConsoleErrorHandler.php index c0ec663a8a7..1165031d956 100644 --- a/lib/Cake/Console/ConsoleErrorHandler.php +++ b/lib/Cake/Console/ConsoleErrorHandler.php @@ -60,7 +60,7 @@ public function handleException(Exception $exception) { $exception->getMessage(), $exception->getTraceAsString() )); - $this->_stop($exception->getCode() ? $exception->getCode() : 1); + return $this->_stop($exception->getCode() ? $exception->getCode() : 1); } /** @@ -88,7 +88,7 @@ public function handleError($code, $description, $file = null, $line = null, $co } if ($log === LOG_ERR) { - $this->_stop(1); + return $this->_stop(1); } } diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php index 82556223ebe..dde22dfedce 100644 --- a/lib/Cake/Console/Shell.php +++ b/lib/Cake/Console/Shell.php @@ -504,7 +504,7 @@ protected function _getInput($prompt, $options, $default) { $result = $this->stdin->read(); if ($result === false) { - $this->_stop(1); + return $this->_stop(1); } $result = trim($result); @@ -618,7 +618,7 @@ public function error($title, $message = null) { if (!empty($message)) { $this->err($message); } - $this->_stop(1); + return $this->_stop(1); } /** @@ -656,7 +656,7 @@ public function createFile($path, $contents) { if (strtolower($key) === 'q') { $this->out(__d('cake_console', 'Quitting.'), 2); - $this->_stop(); + return $this->_stop(); } elseif (strtolower($key) !== 'y') { $this->out(__d('cake_console', 'Skip `%s`', $path), 2); return false; diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index 5e065711f04..16523f357cc 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -65,7 +65,7 @@ public function __construct($args = array(), $bootstrap = true) { */ public static function run($argv) { $dispatcher = new ShellDispatcher($argv); - $dispatcher->_stop($dispatcher->dispatch() === false ? 1 : 0); + return $dispatcher->_stop($dispatcher->dispatch() === false ? 1 : 0); } /**