Skip to content
Permalink
Browse files

Move Console Shells and Tasks.

  • Loading branch information...
dereuromark committed Aug 25, 2014
1 parent 1951b16 commit 6b02f80b10e6a472c1b46a4b7e62fceb0ff13a9a
Showing with 165 additions and 164 deletions.
  1. +1 −1 src/Console/ShellDispatcher.php
  2. +1 −1 src/Console/TaskRegistry.php
  3. +8 −8 src/{Console/Command → Shell}/BakeShell.php
  4. +1 −1 src/{Console/Command → Shell}/CommandListShell.php
  5. +1 −1 src/{Console/Command → Shell}/CompletionShell.php
  6. +1 −1 src/{Console/Command → Shell}/I18nShell.php
  7. +1 −1 src/{Console/Command → Shell}/OrmCacheShell.php
  8. +1 −1 src/{Console/Command → Shell}/ServerShell.php
  9. +1 −1 src/{Console/Command → Shell}/Task/BakeTask.php
  10. +2 −2 src/{Console/Command → Shell}/Task/BehaviorTask.php
  11. +2 −2 src/{Console/Command → Shell}/Task/CellTask.php
  12. +5 −5 src/{Console/Command → Shell}/Task/CommandTask.php
  13. +2 −2 src/{Console/Command → Shell}/Task/ComponentTask.php
  14. +1 −1 src/{Console/Command → Shell}/Task/ControllerTask.php
  15. +1 −1 src/{Console/Command → Shell}/Task/ExtractTask.php
  16. +1 −1 src/{Console/Command → Shell}/Task/FixtureTask.php
  17. +2 −2 src/{Console/Command → Shell}/Task/HelperTask.php
  18. +1 −1 src/{Console/Command → Shell}/Task/ModelTask.php
  19. +3 −3 src/{Console/Command → Shell}/Task/PluginTask.php
  20. +2 −2 src/{Console/Command → Shell}/Task/ProjectTask.php
  21. +3 −3 src/{Console/Command → Shell}/Task/ShellTask.php
  22. +2 −2 src/{Console/Command → Shell}/Task/SimpleBakeTask.php
  23. +1 −1 src/{Console/Command → Shell}/Task/TemplateTask.php
  24. +2 −2 src/{Console/Command → Shell}/Task/TestTask.php
  25. +1 −1 src/{Console/Command → Shell}/Task/ViewTask.php
  26. +1 −1 src/{Console/Command → Shell}/TestShell.php
  27. +2 −1 src/Template/Bake/default/classes/shell.ctp
  28. +6 −6 tests/TestCase/Console/ShellDispatcherTest.php
  29. +7 −7 tests/TestCase/Console/ShellTest.php
  30. +8 −8 tests/TestCase/Console/TaskRegistryTest.php
  31. +2 −2 tests/TestCase/Core/AppTest.php
  32. +6 −6 tests/TestCase/{Console/Command → Shell}/BakeShellTest.php
  33. +5 −5 tests/TestCase/{Console/Command → Shell}/CommandListShellTest.php
  34. +5 −5 tests/TestCase/{Console/Command → Shell}/CompletionShellTest.php
  35. +2 −2 tests/TestCase/{Console/Command → Shell}/OrmCacheShellTest.php
  36. +4 −4 tests/TestCase/{Console/Command → Shell}/Task/CellTaskTest.php
  37. +6 −6 tests/TestCase/{Console/Command → Shell}/Task/ControllerTaskTest.php
  38. +5 −5 tests/TestCase/{Console/Command → Shell}/Task/ExtractTaskTest.php
  39. +5 −5 tests/TestCase/{Console/Command → Shell}/Task/FixtureTaskTest.php
  40. +7 −7 tests/TestCase/{Console/Command → Shell}/Task/ModelTaskTest.php
  41. +5 −5 tests/TestCase/{Console/Command → Shell}/Task/PluginTaskTest.php
  42. +3 −3 tests/TestCase/{Console/Command → Shell}/Task/ProjectTaskTest.php
  43. +8 −8 tests/TestCase/{Console/Command → Shell}/Task/SimpleBakeTaskTest.php
  44. +3 −3 tests/TestCase/{Console/Command → Shell}/Task/TemplateTaskTest.php
  45. +11 −11 tests/TestCase/{Console/Command → Shell}/Task/TestTaskTest.php
  46. +6 −6 tests/TestCase/{Console/Command → Shell}/Task/ViewTaskTest.php
  47. +1 −1 tests/test_app/Plugin/TestPlugin/src/{Console/Command → Shell}/ExampleShell.php
  48. +1 −1 tests/test_app/Plugin/TestPlugin/src/{Console/Command → Shell}/Task/OtherTaskTask.php
  49. +2 −2 tests/test_app/Plugin/TestPlugin/src/{Console/Command → Shell}/Task/WidgetTask.php
  50. +2 −2 tests/test_app/{TestApp/Console/Command → Plugin/TestPlugin/src/Shell}/Task/ZergTask.php
  51. +1 −1 tests/test_app/Plugin/TestPluginTwo/src/{Console/Command → Shell}/ExampleShell.php
  52. 0 tests/test_app/Plugin/TestPluginTwo/src/{Console/Command → Shell}/Task/empty
  53. +1 −1 tests/test_app/Plugin/TestPluginTwo/src/{Console/Command → Shell}/WelcomeShell.php
  54. +1 −1 tests/test_app/TestApp/{Console/Command → Shell}/SampleShell.php
  55. +2 −2 tests/test_app/{Plugin/TestPlugin/src/Console/Command → TestApp/Shell}/Task/ZergTask.php
  56. 0 tests/test_app/TestApp/{Console/Command → Shell}/Task/empty
@@ -198,7 +198,7 @@ public function findShell($shell) {
protected function _shellExists($shell) {
$class = array_map('Cake\Utility\Inflector::camelize', explode('.', $shell));
$class = implode('.', $class);
$class = App::className($class, 'Console/Command', 'Shell');
$class = App::className($class, 'Shell', 'Shell');
if (class_exists($class)) {
return $class;
}
@@ -48,7 +48,7 @@ public function __construct(Shell $Shell) {
* @return string|false Either the correct classname or false.
*/
protected function _resolveClassName($class) {
return App::className($class, 'Console/Command/Task', 'Task');
return App::className($class, 'Shell/Task', 'Task');
}
/**
@@ -12,7 +12,7 @@
* @since 1.2.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command;
namespace Cake\Shell;
use Cake\Cache\Cache;
use Cake\Console\Shell;
@@ -92,11 +92,11 @@ public function main() {
* Locate the tasks bake will use.
*
* Scans the following paths for tasks that are subclasses of
* Cake\Console\Command\Task\BakeTask:
* Cake\Shell\Task\BakeTask:
*
* - Cake/Console/Command/Task/
* - App/Console/Command/Task/
* - Console/Command/Task for each loaded plugin
* - Cake/Shell/Task/
* - App/Shell/Task/
* - Shell/Task for each loaded plugin
*
* @return void
*/
@@ -126,7 +126,7 @@ public function loadTasks() {
* @return array Updated tasks.
*/
protected function _findTasks($tasks, $path, $namespace, $prefix = false) {
$path .= 'Console/Command/Task';
$path .= 'Shell/Task';
if (!is_dir($path)) {
return $tasks;
}
@@ -156,7 +156,7 @@ protected function _findClassFiles($path, $namespace) {
continue;
}
$name = $item->getBasename('.php');
$candidates[] = $namespace . '\Console\Command\Task\\' . $name;
$candidates[] = $namespace . '\Shell\Task\\' . $name;
}
return $candidates;
}
@@ -177,7 +177,7 @@ protected function _findTaskClasses($files) {
if (!$reflect->isInstantiable()) {
continue;
}
if (!$reflect->isSubclassOf('Cake\Console\Command\Task\BakeTask')) {
if (!$reflect->isSubclassOf('Cake\Shell\Task\BakeTask')) {
continue;
}
$classes[] = $className;
@@ -12,7 +12,7 @@
* @since 2.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command;
namespace Cake\Shell;
use Cake\Console\ConsoleOutput;
use Cake\Console\Shell;
@@ -12,7 +12,7 @@
* @since 2.5.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command;
namespace Cake\Shell;
use Cake\Console\Shell;
@@ -14,7 +14,7 @@
* @since 1.2.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command;
namespace Cake\Shell;
use Cake\Console\Shell;
@@ -12,7 +12,7 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command;
namespace Cake\Shell;
use Cake\Cache\Cache;
use Cake\Console\Shell;
@@ -13,7 +13,7 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command;
namespace Cake\Shell;
use Cake\Console\Shell;
use Cake\Core\Configure;
@@ -12,7 +12,7 @@
* @since 1.3.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Cache\Cache;
use Cake\Console\Shell;
@@ -12,9 +12,9 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Command\Task\SimpleBakeTask;
use Cake\Shell\Task\SimpleBakeTask;
/**
* Behavior code generator.
@@ -12,9 +12,9 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Command\Task\SimpleBakeTask;
use Cake\Shell\Task\SimpleBakeTask;
/**
* Task for creating cells.
@@ -12,7 +12,7 @@
* @since 2.5.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\ConsoleOptionParser;
use Cake\Console\Shell;
@@ -41,18 +41,18 @@ public function getShellList() {
$plugins = Plugin::loaded();
$shellList = array_fill_keys($plugins, null) + ['CORE' => null, 'app' => null];
$corePath = App::core('Console/Command');
$corePath = App::core('Shell');
$shells = $this->_scanDir($corePath[0]);
$shells = array_diff($shells, $skipFiles, $hiddenCommands);
$shellList = $this->_appendShells('CORE', $shells, $shellList);
$appPath = App::path('Console/Command');
$appPath = App::path('Shell');
$appShells = $this->_scanDir($appPath[0]);
$appShells = array_diff($appShells, $shells, $skipFiles);
$shellList = $this->_appendShells('app', $appShells, $shellList);
foreach ($plugins as $plugin) {
$pluginPath = Plugin::classPath($plugin) . 'Console' . DS . 'Command';
$pluginPath = Plugin::classPath($plugin) . 'Shell';
$pluginShells = $this->_scanDir($pluginPath);
$shellList = $this->_appendShells($plugin, $pluginShells, $shellList);
}
@@ -178,7 +178,7 @@ public function getShell($commandName) {
$name = Inflector::camelize($name);
$pluginDot = Inflector::camelize($pluginDot);
$class = App::className($pluginDot . $name, 'Console/Command', 'Shell');
$class = App::className($pluginDot . $name, 'Shell', 'Shell');
if (!$class) {
return false;
}
@@ -12,9 +12,9 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Command\Task\SimpleBakeTask;
use Cake\Shell\Task\SimpleBakeTask;
/**
* Component code generator.
@@ -12,7 +12,7 @@
* @since 1.2.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Shell;
use Cake\Core\Configure;
@@ -12,7 +12,7 @@
* @since 1.2.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Shell;
use Cake\Core\App;
@@ -12,7 +12,7 @@
* @since 1.3.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Shell;
use Cake\Core\Configure;
@@ -12,9 +12,9 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Command\Task\SimpleBakeTask;
use Cake\Shell\Task\SimpleBakeTask;
/**
* Helper code generator.
@@ -12,7 +12,7 @@
* @since 1.2.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Shell;
use Cake\Core\Configure;
@@ -12,9 +12,9 @@
* @since 1.2.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Command\Task\BakeTask;
use Cake\Shell\Task\BakeTask;
use Cake\Console\Shell;
use Cake\Core\App;
use Cake\Utility\File;
@@ -101,7 +101,7 @@ public function bake($plugin) {
$classBase . DS . 'Model' . DS . 'Behavior',
$classBase . DS . 'Model' . DS . 'Table',
$classBase . DS . 'Model' . DS . 'Entity',
$classBase . DS . 'Console' . DS . 'Command' . DS . 'Task',
$classBase . DS . 'Shell' . DS . 'Task',
$classBase . DS . 'Controller' . DS . 'Component',
$classBase . DS . 'View' . DS . 'Helper',
$classBase . DS . 'Template',
@@ -12,9 +12,9 @@
* @since 1.2.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Command\Task\BakeTask;
use Cake\Shell\Task\BakeTask;
use Cake\Utility\Folder;
/**
@@ -12,9 +12,9 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Command\Task\SimpleBakeTask;
use Cake\Shell\Task\SimpleBakeTask;
/**
* Shell code generator.
@@ -26,7 +26,7 @@ class ShellTask extends SimpleBakeTask {
*
* @var string
*/
public $pathFragment = 'Console/Command/';
public $pathFragment = 'Shell/';
/**
* {@inheritDoc}
@@ -12,9 +12,9 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Command\Task\BakeTask;
use Cake\Shell\Task\BakeTask;
use Cake\Core\Configure;
use Cake\Core\Plugin;
use Cake\Utility\Inflector;
@@ -12,7 +12,7 @@
* @since 1.3.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Shell;
use Cake\Core\App;
@@ -12,7 +12,7 @@
* @since 1.3.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Shell;
use Cake\Controller\Controller;
@@ -52,7 +52,7 @@ class TestTask extends BakeTask {
'Component' => 'Controller\Component',
'Behavior' => 'Model\Behavior',
'Helper' => 'View\Helper',
'Shell' => 'Console\Command',
'Shell' => 'Shell',
'Cell' => 'View\Cell',
];
@@ -12,7 +12,7 @@
* @since 1.2.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command\Task;
namespace Cake\Shell\Task;
use Cake\Console\Shell;
use Cake\Core\App;
@@ -16,7 +16,7 @@
* @since 1.2.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Console\Command;
namespace Cake\Shell;
use Cake\Console\ConsoleOptionParser;
use Cake\Console\Shell;
@@ -15,7 +15,7 @@
echo "<?php\n";
?>
namespace <?= $namespace ?>\Console\Command;
namespace <?= $namespace ?>\Shell;

use Cake\Console\Shell;

@@ -31,4 +31,5 @@ class <?= $name ?>Shell extends Shell {
*/
public function main() {
}

}
Oops, something went wrong.

0 comments on commit 6b02f80

Please sign in to comment.
You can’t perform that action at this time.