Moving AppShell inside Console/Command for consistency with file location of other App classes. Also making all core shells and tasks extends AppShell instead of Shell. Closes #2278

This commit is contained in:
ADmad 2011-11-26 02:35:00 +05:30
parent 2bffd4c26d
commit 73674c648c
24 changed files with 55 additions and 24 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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() {