Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moving AppShell inside Console/Command for consistency with file loca…

…tion of other App classes. Also making all core shells and tasks extends AppShell instead of Shell. Closes #2278
  • Loading branch information...
commit 73674c648c06536d51f004a20c05a50dc993ac81 1 parent 2bffd4c
ADmad ADmad authored
Showing with 55 additions and 24 deletions.
  1. +3 −1 lib/Cake/Console/Command/AclShell.php
  2. +3 −1 lib/Cake/Console/Command/ApiShell.php
  3. +2 −0  lib/Cake/Console/{ → Command}/AppShell.php
  4. +2 −1  lib/Cake/Console/Command/BakeShell.php
  5. +5 −2 lib/Cake/Console/Command/CommandListShell.php
  6. +3 −1 lib/Cake/Console/Command/ConsoleShell.php
  7. +3 −1 lib/Cake/Console/Command/I18nShell.php
  8. +5 −3 lib/Cake/Console/Command/SchemaShell.php
  9. +3 −2 lib/Cake/Console/Command/Task/BakeTask.php
  10. +1 −0  lib/Cake/Console/Command/Task/ControllerTask.php
  11. +3 −1 lib/Cake/Console/Command/Task/DbConfigTask.php
  12. +3 −1 lib/Cake/Console/Command/Task/ExtractTask.php
  13. +1 −0  lib/Cake/Console/Command/Task/FixtureTask.php
  14. +1 −0  lib/Cake/Console/Command/Task/ModelTask.php
  15. +2 −1  lib/Cake/Console/Command/Task/PluginTask.php
  16. +2 −1  lib/Cake/Console/Command/Task/ProjectTask.php
  17. +3 −1 lib/Cake/Console/Command/Task/TemplateTask.php
  18. +2 −1  lib/Cake/Console/Command/Task/TestTask.php
  19. +1 −0  lib/Cake/Console/Command/Task/ViewTask.php
  20. +2 −2 lib/Cake/Console/Command/TestsuiteShell.php
  21. +2 −1  lib/Cake/Console/Command/UpgradeShell.php
  22. +1 −1  lib/Cake/Console/ShellDispatcher.php
  23. +2 −2 lib/Cake/Core/App.php
  24. 0  lib/Cake/Test/Case/Console/{Command → }/ShellTest.php
4 lib/Cake/Console/Command/AclShell.php
View
@@ -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 @@
*
* @package Cake.Console.Command
*/
-class AclShell extends Shell {
+class AclShell extends AppShell {
/**
* Contains instance of AclComponent
4 lib/Cake/Console/Command/ApiShell.php
View
@@ -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 @@
*
* @package Cake.Console.Command
*/
-class ApiShell extends Shell {
+class ApiShell extends AppShell {
/**
* Map between short name for paths and real paths.
2  lib/Cake/Console/AppShell.php → lib/Cake/Console/Command/AppShell.php
View
@@ -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
3  lib/Cake/Console/Command/BakeShell.php
View
@@ -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 @@
* @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
7 lib/Cake/Console/Command/CommandListShell.php
View
@@ -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 @@
*
* @package Cake.Console.Command
*/
-class CommandListShell extends Shell {
+class CommandListShell extends AppShell {
/**
* startup
@@ -80,13 +81,15 @@ public function main() {
*/
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();
4 lib/Cake/Console/Command/ConsoleShell.php
View
@@ -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
4 lib/Cake/Console/Command/I18nShell.php
View
@@ -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
8 lib/Cake/Console/Command/SchemaShell.php
View
@@ -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 @@
* @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 @@ public function generate() {
if (isset($this->params['snapshot'])) {
$numToUse = $this->params['snapshot'];
}
-
+
$count = 0;
if (!empty($result[1])) {
foreach ($result[1] as $file) {
@@ -181,7 +183,7 @@ public function generate() {
$count = $numToUse;
}
}
-
+
$content['file'] = $fileName . '_' . $count . '.php';
}
5 lib/Cake/Console/Command/Task/BakeTask.php
View
@@ -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
1  lib/Cake/Console/Command/Task/ControllerTask.php
View
@@ -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');
4 lib/Cake/Console/Command/Task/DbConfigTask.php
View
@@ -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
4 lib/Cake/Console/Command/Task/ExtractTask.php
View
@@ -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 @@
*
* @package Cake.Console.Command.Task
*/
-class ExtractTask extends Shell {
+class ExtractTask extends AppShell {
/**
* Paths to use when looking for strings
1  lib/Cake/Console/Command/Task/FixtureTask.php
View
@@ -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');
1  lib/Cake/Console/Command/Task/ModelTask.php
View
@@ -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');
3  lib/Cake/Console/Command/Task/PluginTask.php
View
@@ -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 @@
*
* @package Cake.Console.Command.Task
*/
-class PluginTask extends Shell {
+class PluginTask extends AppShell {
/**
* path to plugins directory
3  lib/Cake/Console/Command/Task/ProjectTask.php
View
@@ -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 @@
*
* @package Cake.Console.Command.Task
*/
-class ProjectTask extends Shell {
+class ProjectTask extends AppShell {
/**
* configs path (used in testing).
4 lib/Cake/Console/Command/Task/TemplateTask.php
View
@@ -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
3  lib/Cake/Console/Command/Task/TestTask.php
View
@@ -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 @@ public function getOptionParser() {
->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',
1  lib/Cake/Console/Command/Task/ViewTask.php
View
@@ -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');
4 lib/Cake/Console/Command/TestsuiteShell.php
View
@@ -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 @@
*
* @package Cake.Console.Command
*/
-class TestsuiteShell extends Shell {
+class TestsuiteShell extends AppShell {
/**
* Dispatcher object for the run.
3  lib/Cake/Console/Command/UpgradeShell.php
View
@@ -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 @@
*
* @package Cake.Console.Command
*/
-class UpgradeShell extends Shell {
+class UpgradeShell extends AppShell {
/**
* Files
2  lib/Cake/Console/ShellDispatcher.php
View
@@ -210,7 +210,7 @@ protected function _getShell($shell) {
$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)) {
4 lib/Cake/Core/App.php
View
@@ -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 @@ protected static function _mapped($name, $plugin = null) {
/**
* Sets then returns the templates for each customizable package path
- *
+ *
* @return array templates for each customizable package path
*/
protected static function _packageFormat() {
0  lib/Cake/Test/Case/Console/Command/ShellTest.php → lib/Cake/Test/Case/Console/ShellTest.php
View
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.