diff --git a/lib/Cake/Console/Command/AclShell.php b/lib/Cake/Console/Command/AclShell.php index 364947e79..081eaf349 100644 --- a/lib/Cake/Console/Command/AclShell.php +++ b/lib/Cake/Console/Command/AclShell.php @@ -82,7 +82,7 @@ class AclShell extends AppShell { $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 584d24638..200b67b8b 100644 --- a/lib/Cake/Console/Command/ApiShell.php +++ b/lib/Cake/Console/Command/ApiShell.php @@ -100,7 +100,7 @@ class ApiShell extends AppShell { 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 db069fa74..90acff90e 100644 --- a/lib/Cake/Console/Command/SchemaShell.php +++ b/lib/Cake/Console/Command/SchemaShell.php @@ -106,11 +106,11 @@ class SchemaShell extends AppShell { $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 @@ class SchemaShell extends AppShell { 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 @@ class SchemaShell extends AppShell { $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 @@ class SchemaShell extends AppShell { 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 @@ class SchemaShell extends AppShell { $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 @@ class SchemaShell extends AppShell { } 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 @@ class SchemaShell extends AppShell { 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 4c59b498b..cd401c487 100644 --- a/lib/Cake/Console/Command/Task/ControllerTask.php +++ b/lib/Cake/Console/Command/Task/ControllerTask.php @@ -289,7 +289,7 @@ class ControllerTask extends BakeTask { 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 55076d5fc..d0e4572ac 100644 --- a/lib/Cake/Console/Command/Task/DbConfigTask.php +++ b/lib/Cake/Console/Command/Task/DbConfigTask.php @@ -77,7 +77,7 @@ class DbConfigTask extends AppShell { 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 c9fece3f3..4648c1e47 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -207,7 +207,7 @@ class ExtractTask extends AppShell { $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 d2232b188..0ff102454 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -911,7 +911,7 @@ class ModelTask extends BakeTask { } 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 @@ class ModelTask extends BakeTask { 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 58fa4e4e4..cc63d0846 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -417,7 +417,7 @@ class ProjectTask extends AppShell { $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 98aeb1587..38ceb5c5c 100644 --- a/lib/Cake/Console/Command/Task/ViewTask.php +++ b/lib/Cake/Console/Command/Task/ViewTask.php @@ -267,7 +267,7 @@ class ViewTask extends BakeTask { 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 @@ class ViewTask extends BakeTask { $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 c0ec663a8..1165031d9 100644 --- a/lib/Cake/Console/ConsoleErrorHandler.php +++ b/lib/Cake/Console/ConsoleErrorHandler.php @@ -60,7 +60,7 @@ class ConsoleErrorHandler { $exception->getMessage(), $exception->getTraceAsString() )); - $this->_stop($exception->getCode() ? $exception->getCode() : 1); + return $this->_stop($exception->getCode() ? $exception->getCode() : 1); } /** @@ -88,7 +88,7 @@ class ConsoleErrorHandler { } 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 82556223e..dde22dfed 100644 --- a/lib/Cake/Console/Shell.php +++ b/lib/Cake/Console/Shell.php @@ -504,7 +504,7 @@ class Shell extends Object { $result = $this->stdin->read(); if ($result === false) { - $this->_stop(1); + return $this->_stop(1); } $result = trim($result); @@ -618,7 +618,7 @@ class Shell extends Object { if (!empty($message)) { $this->err($message); } - $this->_stop(1); + return $this->_stop(1); } /** @@ -656,7 +656,7 @@ class Shell extends Object { 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 5e065711f..16523f357 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -65,7 +65,7 @@ class ShellDispatcher { */ public static function run($argv) { $dispatcher = new ShellDispatcher($argv); - $dispatcher->_stop($dispatcher->dispatch() === false ? 1 : 0); + return $dispatcher->_stop($dispatcher->dispatch() === false ? 1 : 0); } /**