Skip to content
Permalink
Browse files

Adding Shell::dispatchShell() will replace $this->Dispatch->dispatch …

…use in Shells.
  • Loading branch information...
markstory committed Oct 16, 2010
1 parent e85482f commit 28fc07c055d0853f453cc2432e5a9bc18ee89880
Showing with 16 additions and 0 deletions.
  1. +16 −0 cake/console/libs/shell.php
@@ -316,6 +316,22 @@ public function hasMethod($name) {
}
}
/**
* Dispatch a command to another Shell. Similar to Object::requestAction()
* but intended for running shells from other shells.
*
* @param mixed $command Either an array of args similar to $argv. Or a string command, that can be
* exploded on space to simulate argv.
* @return mixed. The return of the other shell.
*/
public function dispatchShell($command) {
if (is_string($command)) {
$command = explode(' ', $command);
}
$Dispatcher = new ShellDispatcher($command);
return $Dispatcher->dispatch();
}
/**
* Runs the Shell with the provided argv
*

0 comments on commit 28fc07c

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