Fixing more console classes

This commit is contained in:
José Lorenzo Rodríguez 2010-12-07 01:44:17 -04:30
parent e3690ebccb
commit b5122e6e81
8 changed files with 14 additions and 14 deletions

View file

@ -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.
*

View file

@ -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);

View file

@ -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');
/**

View file

@ -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

View file

@ -21,6 +21,7 @@
App::uses('TaskCollection', 'Console');
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
App::uses('ConsoleInputSubcommand', 'Console');
App::uses('ConsoleOptionParser', 'Console');
/**

View file

@ -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));

View file

@ -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);
}

View file

@ -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.