diff --git a/lib/Cake/Console/Command/AclShell.php b/lib/Cake/Console/Command/AclShell.php index b2dec95d3..3e1ba5b8d 100644 --- a/lib/Cake/Console/Command/AclShell.php +++ b/lib/Cake/Console/Command/AclShell.php @@ -15,6 +15,8 @@ * @since CakePHP(tm) v 1.2.0.5012 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ + +App::uses('AppShell', 'Console/Command'); App::uses('ComponentCollection', 'Controller'); App::uses('AclComponent', 'Controller/Component'); App::uses('DbAcl', 'Model'); @@ -25,7 +27,7 @@ App::uses('DbAcl', 'Model'); * * @package Cake.Console.Command */ -class AclShell extends Shell { +class AclShell extends AppShell { /** * Contains instance of AclComponent diff --git a/lib/Cake/Console/Command/ApiShell.php b/lib/Cake/Console/Command/ApiShell.php index 6b7c3b2d0..3c0e0f834 100644 --- a/lib/Cake/Console/Command/ApiShell.php +++ b/lib/Cake/Console/Command/ApiShell.php @@ -17,6 +17,8 @@ * @since CakePHP(tm) v 1.2.0.5012 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ + +App::uses('AppShell', 'Console/Command'); App::uses('File', 'Utility'); /** @@ -24,7 +26,7 @@ App::uses('File', 'Utility'); * * @package Cake.Console.Command */ -class ApiShell extends Shell { +class ApiShell extends AppShell { /** * Map between short name for paths and real paths. diff --git a/lib/Cake/Console/AppShell.php b/lib/Cake/Console/Command/AppShell.php similarity index 96% rename from lib/Cake/Console/AppShell.php rename to lib/Cake/Console/Command/AppShell.php index b3f565622..7cbf6e006 100644 --- a/lib/Cake/Console/AppShell.php +++ b/lib/Cake/Console/Command/AppShell.php @@ -16,6 +16,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('Shell', 'Console'); + /** * This is a placeholder class. * Create the same file in app/Console/Command/AppShell.php diff --git a/lib/Cake/Console/Command/BakeShell.php b/lib/Cake/Console/Command/BakeShell.php index 82e67b3e5..7816909c0 100644 --- a/lib/Cake/Console/Command/BakeShell.php +++ b/lib/Cake/Console/Command/BakeShell.php @@ -20,6 +20,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('Model', 'Model'); /** @@ -28,7 +29,7 @@ App::uses('Model', 'Model'); * @package Cake.Console.Command * @link http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html */ -class BakeShell extends Shell { +class BakeShell extends AppShell { /** * Contains tasks to load and instantiate diff --git a/lib/Cake/Console/Command/CommandListShell.php b/lib/Cake/Console/Command/CommandListShell.php index 051436a7d..b69d9696a 100644 --- a/lib/Cake/Console/Command/CommandListShell.php +++ b/lib/Cake/Console/Command/CommandListShell.php @@ -17,6 +17,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('Inflector', 'Utility'); /** @@ -24,7 +25,7 @@ App::uses('Inflector', 'Utility'); * * @package Cake.Console.Command */ -class CommandListShell extends Shell { +class CommandListShell extends AppShell { /** * startup @@ -80,13 +81,15 @@ class CommandListShell extends Shell { */ protected function _getShellList() { $shellList = array(); + $skipFiles = array('AppShell'); $corePath = App::core('Console/Command'); $shells = App::objects('file', $corePath[0]); + $shells = array_diff($shells, $skipFiles); $shellList = $this->_appendShells('CORE', $shells, $shellList); $appShells = App::objects('Console/Command', null, false); - $appShells = array_diff($appShells, $shells); + $appShells = array_diff($appShells, $shells, $skipFiles); $shellList = $this->_appendShells('app', $appShells, $shellList); $plugins = CakePlugin::loaded(); diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php index 6f332bca9..dfd65eacb 100644 --- a/lib/Cake/Console/Command/ConsoleShell.php +++ b/lib/Cake/Console/Command/ConsoleShell.php @@ -16,12 +16,14 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); + /** * Provides a very basic 'interactive' console for CakePHP apps. * * @package Cake.Console.Command */ -class ConsoleShell extends Shell { +class ConsoleShell extends AppShell { /** * Available binding types diff --git a/lib/Cake/Console/Command/I18nShell.php b/lib/Cake/Console/Command/I18nShell.php index 3db544b38..0605a8283 100644 --- a/lib/Cake/Console/Command/I18nShell.php +++ b/lib/Cake/Console/Command/I18nShell.php @@ -16,12 +16,14 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); + /** * Shell for I18N management. * * @package Cake.Console.Command */ -class I18nShell extends Shell { +class I18nShell extends AppShell { /** * Contains database source to use diff --git a/lib/Cake/Console/Command/SchemaShell.php b/lib/Cake/Console/Command/SchemaShell.php index d8d03dd44..c65429cc3 100644 --- a/lib/Cake/Console/Command/SchemaShell.php +++ b/lib/Cake/Console/Command/SchemaShell.php @@ -18,6 +18,8 @@ * @since CakePHP(tm) v 1.2.0.5550 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ + +App::uses('AppShell', 'Console/Command'); App::uses('File', 'Utility'); App::uses('Folder', 'Utility'); App::uses('CakeSchema', 'Model'); @@ -28,7 +30,7 @@ App::uses('CakeSchema', 'Model'); * @package Cake.Console.Command * @link http://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html */ -class SchemaShell extends Shell { +class SchemaShell extends AppShell { /** * Schema class being used. @@ -166,7 +168,7 @@ class SchemaShell extends Shell { if (isset($this->params['snapshot'])) { $numToUse = $this->params['snapshot']; } - + $count = 0; if (!empty($result[1])) { foreach ($result[1] as $file) { @@ -181,7 +183,7 @@ class SchemaShell extends Shell { $count = $numToUse; } } - + $content['file'] = $fileName . '_' . $count . '.php'; } diff --git a/lib/Cake/Console/Command/Task/BakeTask.php b/lib/Cake/Console/Command/Task/BakeTask.php index ea3a8973e..c2a3257e0 100644 --- a/lib/Cake/Console/Command/Task/BakeTask.php +++ b/lib/Cake/Console/Command/Task/BakeTask.php @@ -16,13 +16,14 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::uses('Shell', 'Console'); +App::uses('AppShell', 'Console/Command'); + /** * Base class for Bake Tasks. * * @package Cake.Console.Command.Task */ -class BakeTask extends Shell { +class BakeTask extends AppShell { /** * Name of plugin diff --git a/lib/Cake/Console/Command/Task/ControllerTask.php b/lib/Cake/Console/Command/Task/ControllerTask.php index d7797024c..621b95cc8 100644 --- a/lib/Cake/Console/Command/Task/ControllerTask.php +++ b/lib/Cake/Console/Command/Task/ControllerTask.php @@ -16,6 +16,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('BakeTask', 'Console/Command/Task'); App::uses('AppModel', 'Model'); diff --git a/lib/Cake/Console/Command/Task/DbConfigTask.php b/lib/Cake/Console/Command/Task/DbConfigTask.php index 3d61baaea..74ce2f6ce 100644 --- a/lib/Cake/Console/Command/Task/DbConfigTask.php +++ b/lib/Cake/Console/Command/Task/DbConfigTask.php @@ -16,12 +16,14 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); + /** * Task class for creating and updating the database configuration file. * * @package Cake.Console.Command.Task */ -class DbConfigTask extends Shell { +class DbConfigTask extends AppShell { /** * path to CONFIG directory diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index 8b30e87dd..ed28c196b 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -15,6 +15,8 @@ * @since CakePHP(tm) v 1.2.0.5012 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ + +App::uses('AppShell', 'Console/Command'); App::uses('File', 'Utility'); App::uses('Folder', 'Utility'); @@ -23,7 +25,7 @@ App::uses('Folder', 'Utility'); * * @package Cake.Console.Command.Task */ -class ExtractTask extends Shell { +class ExtractTask extends AppShell { /** * Paths to use when looking for strings diff --git a/lib/Cake/Console/Command/Task/FixtureTask.php b/lib/Cake/Console/Command/Task/FixtureTask.php index 284f1c25a..55cde1e6f 100644 --- a/lib/Cake/Console/Command/Task/FixtureTask.php +++ b/lib/Cake/Console/Command/Task/FixtureTask.php @@ -16,6 +16,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('BakeTask', 'Console/Command/Task'); App::uses('Model', 'Model'); diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index 01f1d7c41..959b3b5e1 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -16,6 +16,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('BakeTask', 'Console/Command/Task'); App::uses('ConnectionManager', 'Model'); App::uses('Model', 'Model'); diff --git a/lib/Cake/Console/Command/Task/PluginTask.php b/lib/Cake/Console/Command/Task/PluginTask.php index af231e234..d8ee72735 100644 --- a/lib/Cake/Console/Command/Task/PluginTask.php +++ b/lib/Cake/Console/Command/Task/PluginTask.php @@ -16,6 +16,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('File', 'Utility'); App::uses('Folder', 'Utility'); @@ -24,7 +25,7 @@ App::uses('Folder', 'Utility'); * * @package Cake.Console.Command.Task */ -class PluginTask extends Shell { +class PluginTask extends AppShell { /** * path to plugins directory diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php index 8784c4cde..e9e919cfb 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -17,6 +17,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('File', 'Utility'); App::uses('Folder', 'Utility'); App::uses('String', 'Utility'); @@ -27,7 +28,7 @@ App::uses('Security', 'Utility'); * * @package Cake.Console.Command.Task */ -class ProjectTask extends Shell { +class ProjectTask extends AppShell { /** * configs path (used in testing). diff --git a/lib/Cake/Console/Command/Task/TemplateTask.php b/lib/Cake/Console/Command/Task/TemplateTask.php index ee517cc9d..36ac622ef 100644 --- a/lib/Cake/Console/Command/Task/TemplateTask.php +++ b/lib/Cake/Console/Command/Task/TemplateTask.php @@ -16,14 +16,16 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('Folder', 'Utility'); + /** * Template Task can generate templated output Used in other Tasks. * Acts like a simplified View class. * * @package Cake.Console.Command.Task */ -class TemplateTask extends Shell { +class TemplateTask extends AppShell { /** * variables to add to template scope diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php index a1265bf90..d46a407d7 100644 --- a/lib/Cake/Console/Command/Task/TestTask.php +++ b/lib/Cake/Console/Command/Task/TestTask.php @@ -16,6 +16,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('BakeTask', 'Console/Command/Task'); App::uses('ClassRegistry', 'Utility'); @@ -472,7 +473,7 @@ class TestTask extends BakeTask { ->addArgument('type', array( 'help' => __d('cake_console', 'Type of class to bake, can be any of the following: controller, model, helper, component or behavior.'), 'choices' => array( - 'Controller', 'controller', + 'Controller', 'controller', 'Model', 'model', 'Helper', 'helper', 'Component', 'component', diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php index fff2572e8..8efc83345 100644 --- a/lib/Cake/Console/Command/Task/ViewTask.php +++ b/lib/Cake/Console/Command/Task/ViewTask.php @@ -16,6 +16,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('Controller', 'Controller'); App::uses('BakeTask', 'Console/Command/Task'); diff --git a/lib/Cake/Console/Command/TestsuiteShell.php b/lib/Cake/Console/Command/TestsuiteShell.php index 5c870b900..aa66842de 100644 --- a/lib/Cake/Console/Command/TestsuiteShell.php +++ b/lib/Cake/Console/Command/TestsuiteShell.php @@ -18,7 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::uses('Shell', 'Console'); +App::uses('AppShell', 'Console/Command'); App::uses('CakeTestSuiteDispatcher', 'TestSuite'); App::uses('CakeTestSuiteCommand', 'TestSuite'); App::uses('CakeTestLoader', 'TestSuite'); @@ -29,7 +29,7 @@ App::uses('CakeTestLoader', 'TestSuite'); * * @package Cake.Console.Command */ -class TestsuiteShell extends Shell { +class TestsuiteShell extends AppShell { /** * Dispatcher object for the run. diff --git a/lib/Cake/Console/Command/UpgradeShell.php b/lib/Cake/Console/Command/UpgradeShell.php index 66d59be5b..cf3c91858 100644 --- a/lib/Cake/Console/Command/UpgradeShell.php +++ b/lib/Cake/Console/Command/UpgradeShell.php @@ -17,6 +17,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppShell', 'Console/Command'); App::uses('Folder', 'Utility'); /** @@ -24,7 +25,7 @@ App::uses('Folder', 'Utility'); * * @package Cake.Console.Command */ -class UpgradeShell extends Shell { +class UpgradeShell extends AppShell { /** * Files diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index e3320fc7b..622cc9764 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -210,7 +210,7 @@ class ShellDispatcher { $class = Inflector::camelize($shell) . 'Shell'; App::uses('Shell', 'Console'); - App::uses('AppShell', 'Console'); + App::uses('AppShell', 'Console/Command'); App::uses($class, $plugin . 'Console/Command'); if (!class_exists($class)) { diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index a9d034fee..f55fc400a 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -99,7 +99,7 @@ class App { 'view' => array('suffix' => 'View', 'extends' => null, 'core' => true), 'helper' => array('suffix' => 'Helper', 'extends' => 'AppHelper', 'core' => true), 'vendor' => array('extends' => null, 'core' => true), - 'shell' => array('suffix' => 'Shell', 'extends' => 'Shell', 'core' => true), + 'shell' => array('suffix' => 'Shell', 'extends' => 'AppShell', 'core' => true), 'plugin' => array('extends' => null, 'core' => true) ); @@ -794,7 +794,7 @@ class App { /** * Sets then returns the templates for each customizable package path - * + * * @return array templates for each customizable package path */ protected static function _packageFormat() { diff --git a/lib/Cake/Test/Case/Console/Command/ShellTest.php b/lib/Cake/Test/Case/Console/ShellTest.php similarity index 100% rename from lib/Cake/Test/Case/Console/Command/ShellTest.php rename to lib/Cake/Test/Case/Console/ShellTest.php