Skip to content

Commit

Permalink
Fixing more console classes
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Dec 7, 2010
1 parent e3690eb commit b5122e6
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 0 additions & 2 deletions lib/Cake/Console/Command/CommandListShell.php
Expand Up @@ -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.
*
Expand Down
5 changes: 2 additions & 3 deletions lib/Cake/Console/Command/Task/ModelTask.php
Expand Up @@ -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.
Expand Down Expand Up @@ -791,7 +792,6 @@ public function getTable($modelName, $useDbConfig = null) {
if (!isset($useDbConfig)) {
$useDbConfig = $this->connection;
}
App::import('Model', 'ConnectionManager', false);

$db = ConnectionManager::getDataSource($useDbConfig);
$useTable = Inflector::tableize($modelName);
Expand Down Expand Up @@ -820,7 +820,6 @@ public function getAllTables($useDbConfig = null) {
if (!isset($useDbConfig)) {
$useDbConfig = $this->connection;
}
App::import('Model', 'ConnectionManager', false);

$tables = array();
$db = ConnectionManager::getDataSource($useDbConfig);
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/Console/ConsoleOptionParser.php
Expand Up @@ -21,6 +21,7 @@
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
App::uses('ConsoleInputOption', 'Console');
App::uses('ConsoleInputArgument', 'Console');
App::uses('ConsoleOptionParser', 'Console');

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/HelpFormatter.php
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/Console/Shell.php
Expand Up @@ -21,6 +21,7 @@
App::uses('TaskCollection', 'Console');
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
App::uses('ConsoleInputSubcommand', 'Console');
App::uses('ConsoleOptionParser', 'Console');

/**
Expand Down
5 changes: 4 additions & 1 deletion lib/Cake/Console/ShellDispatcher.php
Expand Up @@ -209,8 +209,11 @@ public function dispatch() {
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));
Expand Down
4 changes: 1 addition & 3 deletions lib/Cake/Console/TaskCollection.php
Expand Up @@ -61,10 +61,8 @@ public function load($task, $settings = array(), $enable = true) {
}
$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);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Model/Model.php
Expand Up @@ -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.
Expand Down

0 comments on commit b5122e6

Please sign in to comment.