Browse Source

Updating CommandListShell to use the new CakePLugin class

Jose Lorenzo Rodriguez 15 years ago
parent
commit
e78345035a

+ 3 - 3
lib/Cake/Console/Command/CommandListShell.php

@@ -86,7 +86,7 @@ class CommandListShell extends Shell {
 		$appShells = App::objects('Console/Command', null, false);
 		$shellList = $this->_appendShells('app', $appShells, $shellList);
 
-		$plugins = App::objects('plugin');
+		$plugins = CakePlugin::loaded();
 		foreach ($plugins as $plugin) {
 			$pluginShells = App::objects($plugin . '.Console/Command');
 			$shellList = $this->_appendShells($plugin, $pluginShells, $shellList);
@@ -187,13 +187,13 @@ class CommandListShell extends Shell {
  * @return void
  */
 	protected function _asXml($shellList) {
-		$plugins = App::objects('plugin');
+		$plugins = CakePlugin::loaded();
 		$shells = new SimpleXmlElement('<shells></shells>');
 		foreach ($shellList as $name => $location) {
 			$source = current($location);
 			$callable = $name;
 			if (in_array($source, $plugins)) {
-				$callable = Inflector::underscore($source) . '.' . $name;
+				$callable = Inflector::camelize($source) . '.' . $name;
 			}
 			$shell = $shells->addChild('shell');
 			$shell->addAttribute('name', $name);

lib/Cake/tests/test_app/plugins/TestPlugin/Console/Command/example.php → lib/Cake/tests/test_app/plugins/TestPlugin/Console/Command/ExampleShell.php


lib/Cake/tests/test_app/plugins/TestPluginTwo/Console/Command/example.php → lib/Cake/tests/test_app/plugins/TestPluginTwo/Console/Command/ExampleShell.php


lib/Cake/tests/test_app/plugins/TestPluginTwo/Console/Command/welcome.php → lib/Cake/tests/test_app/plugins/TestPluginTwo/Console/Command/WelcomeShell.php