mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
fixing arg shifting in shells for php4
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5240 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
76a4ae2a79
commit
0a52326b0c
2 changed files with 4 additions and 6 deletions
|
@ -280,10 +280,9 @@ class ShellDispatcher {
|
|||
$this->help();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$task = Inflector::camelize($command);
|
||||
if(in_array($task, $shell->taskNames)) {
|
||||
$this->shiftArgs();
|
||||
$shell->{$task}->initialize();
|
||||
$shell->{$task}->loadTasks();
|
||||
$shell->{$task}->startup();
|
||||
|
@ -313,7 +312,6 @@ class ShellDispatcher {
|
|||
}
|
||||
|
||||
if($missingCommand && method_exists($shell, 'main')) {
|
||||
$this->args = am(array($command), $this->args);
|
||||
$shell->startup();
|
||||
$shell->main();
|
||||
} else if($missingCommand && method_exists($shell, 'help')) {
|
||||
|
|
|
@ -127,10 +127,10 @@ class Shell extends Object {
|
|||
ClassRegistry::map($shellKey, $shellKey);
|
||||
if(!PHP5 && isset($this->args[0]) && strpos(low(get_class($this)), low(Inflector::camelize($this->args[0]))) !== false) {
|
||||
$dispatch->shiftArgs();
|
||||
}
|
||||
if(!PHP5 && isset($this->args[0]) && low($this->command) == low(Inflector::variable($this->args[0]))) {
|
||||
}
|
||||
if(!PHP5 && isset($this->args[0]) && low($this->command) == low(Inflector::variable($this->args[0])) && method_exists($this, $this->command)) {
|
||||
$dispatch->shiftArgs();
|
||||
}
|
||||
}
|
||||
$this->Dispatch =& $dispatch;
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue