Adding backwards compatible plugin syntax.

Thie got lost during 2.0, and it inflecting only the shell name
is kind of bad.
This commit is contained in:
mark_story 2011-10-19 21:33:03 -04:00
parent bad819773e
commit 7a4aa401d1
2 changed files with 6 additions and 0 deletions

View file

@ -206,6 +206,7 @@ class ShellDispatcher {
protected function _getShell($shell) {
list($plugin, $shell) = pluginSplit($shell, true);
$plugin = Inflector::camelize($plugin);
$class = Inflector::camelize($shell) . 'Shell';
App::uses('Shell', 'Console');

View file

@ -129,6 +129,7 @@ class ShellDispatcherTest extends CakeTestCase {
* @return void
*/
public function tearDown() {
parent::tearDown();
CakePlugin::unload();
}
@ -399,6 +400,10 @@ class ShellDispatcherTest extends CakeTestCase {
$result = $Dispatcher->getShell('sample');
$this->assertInstanceOf('SampleShell', $result);
$Dispatcher = new TestShellDispatcher();
$result = $Dispatcher->getShell('test_plugin.example');
$this->assertInstanceOf('ExampleShell', $result);
$Dispatcher = new TestShellDispatcher();
$result = $Dispatcher->getShell('TestPlugin.example');
$this->assertInstanceOf('ExampleShell', $result);