diff --git a/lib/Cake/Console/Command/CommandListShell.php b/lib/Cake/Console/Command/CommandListShell.php index 4df4dc847..65a576b48 100644 --- a/lib/Cake/Console/Command/CommandListShell.php +++ b/lib/Cake/Console/Command/CommandListShell.php @@ -18,8 +18,6 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::uses('Shell', 'Console'); - /** * Shows a list of commands available from the console. * diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index 7616ef14c..c893de33a 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -18,7 +18,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -include_once dirname(__FILE__) . DS . 'bake.php'; +App::uses('BakeTask', 'Console/Command/Task'); +App::uses('ConnectionManager', 'Model'); /** * Task class for creating and updating model files. @@ -791,7 +792,6 @@ class ModelTask extends BakeTask { if (!isset($useDbConfig)) { $useDbConfig = $this->connection; } - App::import('Model', 'ConnectionManager', false); $db = ConnectionManager::getDataSource($useDbConfig); $useTable = Inflector::tableize($modelName); @@ -820,7 +820,6 @@ class ModelTask extends BakeTask { if (!isset($useDbConfig)) { $useDbConfig = $this->connection; } - App::import('Model', 'ConnectionManager', false); $tables = array(); $db = ConnectionManager::getDataSource($useDbConfig); diff --git a/lib/Cake/Console/ConsoleOptionParser.php b/lib/Cake/Console/ConsoleOptionParser.php index 8eec763d6..179999a1b 100644 --- a/lib/Cake/Console/ConsoleOptionParser.php +++ b/lib/Cake/Console/ConsoleOptionParser.php @@ -21,6 +21,7 @@ App::uses('TaskCollection', 'Console'); App::uses('ConsoleOutput', 'Console'); App::uses('ConsoleInput', 'Console'); App::uses('ConsoleInputOption', 'Console'); +App::uses('ConsoleInputArgument', 'Console'); App::uses('ConsoleOptionParser', 'Console'); /** diff --git a/lib/Cake/Console/HelpFormatter.php b/lib/Cake/Console/HelpFormatter.php index 002689899..0b7add61d 100644 --- a/lib/Cake/Console/HelpFormatter.php +++ b/lib/Cake/Console/HelpFormatter.php @@ -17,7 +17,7 @@ * @since CakePHP(tm) v 2.0 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Core', 'String', false); +App::import('String', 'Utility'); /** * HelpFormatter formats help for console shells. Can format to either diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php index 4f40bc8de..ff671ef34 100644 --- a/lib/Cake/Console/Shell.php +++ b/lib/Cake/Console/Shell.php @@ -21,6 +21,7 @@ App::uses('TaskCollection', 'Console'); App::uses('ConsoleOutput', 'Console'); App::uses('ConsoleInput', 'Console'); +App::uses('ConsoleInputSubcommand', 'Console'); App::uses('ConsoleOptionParser', 'Console'); /** diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index ad75dd1d7..45b07f0c5 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -209,8 +209,11 @@ class ShellDispatcher { protected function _getShell($shell) { list($plugin, $shell) = pluginSplit($shell, true); + $class = Inflector::camelize($shell) . 'Shell'; - $loaded = App::uses($class, $plugin . 'Console/Command'); + + App::uses('Shell', 'Console'); + App::uses($class, $plugin . 'Console/Command'); if (!class_exists($class)) { throw new MissingShellFileException(array('shell' => $shell)); diff --git a/lib/Cake/Console/TaskCollection.php b/lib/Cake/Console/TaskCollection.php index 00a1c4b54..b681d571d 100644 --- a/lib/Cake/Console/TaskCollection.php +++ b/lib/Cake/Console/TaskCollection.php @@ -61,10 +61,8 @@ class TaskCollection extends ObjectCollection { } $taskFile = Inflector::underscore($name); $taskClass = $name . 'Task'; + App::uses($taskClass, 'Console/Command/Task'); if (!class_exists($taskClass)) { - if (!App::import('Shell', $plugin . $this->taskPathPrefix . $name)) { - throw new MissingTaskFileException($taskFile . '.php'); - } if (!class_exists($taskClass)) { throw new MissingTaskClassException($taskClass); } diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 9cb46a682..3c3f234e9 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -23,13 +23,13 @@ /** * Included libs */ -App::uses('ClassRegistry', 'Core'); -App::uses('Validation', 'Core'); -App::uses('String', 'Core'); +App::uses('ClassRegistry', 'Utility'); +App::uses('Validation', 'Utility'); +App::uses('String', 'Utility'); App::uses('BehaviorCollection', 'Model'); App::uses('ModelBehavior', 'Model'); App::uses('ConnectionManager', 'Model'); -App::uses('Xml', 'Core'); +App::uses('Xml', 'Utility'); /** * Object-relational mapper.