|
|
@ -137,14 +137,14 @@ class Shell {
|
|
|
|
|
|
|
|
|
|
|
|
$shellKey = Inflector::underscore($this->className);
|
|
|
|
$shellKey = Inflector::underscore($this->className);
|
|
|
|
|
|
|
|
|
|
|
|
if (!PHP5 && isset($this->args[0])) {
|
|
|
|
# if (!PHP5 && isset($this->args[0])) {
|
|
|
|
if(strpos($this->className, strtolower(Inflector::camelize($this->args[0]))) !== false) {
|
|
|
|
# if(strpos($this->className, strtolower(Inflector::camelize($this->args[0]))) !== false) {
|
|
|
|
$dispatch->shiftArgs();
|
|
|
|
# $dispatch->shiftArgs();
|
|
|
|
}
|
|
|
|
# }
|
|
|
|
if (strtolower($this->command) == strtolower(Inflector::variable($this->args[0])) && method_exists($this, $this->command)) {
|
|
|
|
# if (strtolower($this->command) == strtolower(Inflector::variable($this->args[0])) && method_exists($this, $this->command)) {
|
|
|
|
$dispatch->shiftArgs();
|
|
|
|
# $dispatch->shiftArgs();
|
|
|
|
}
|
|
|
|
# }
|
|
|
|
}
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
|
|
$this->Dispatch =& $dispatch;
|
|
|
|
$this->Dispatch =& $dispatch;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -210,22 +210,23 @@ if ( empty($this->params['q'] ) ) {
|
|
|
|
if ($taskName == 'Add' || $taskName == 'Update') {
|
|
|
|
if ($taskName == 'Add' || $taskName == 'Update') {
|
|
|
|
$taskClass = 'CliEdit';
|
|
|
|
$taskClass = 'CliEdit';
|
|
|
|
|
|
|
|
|
|
|
|
} elseif (!class_exists($taskClass)) {
|
|
|
|
|
|
|
|
foreach ($this->Dispatch->shellPaths as $path) {
|
|
|
|
|
|
|
|
$taskPath = $path . 'tasks' . DS . $task.'.php';
|
|
|
|
|
|
|
|
if (file_exists($taskPath)) {
|
|
|
|
|
|
|
|
require_once $taskPath;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# elseif (!class_exists($taskClass)) {
|
|
|
|
|
|
|
|
# foreach ($this->Dispatch->shellPaths as $path) {
|
|
|
|
|
|
|
|
# $taskPath = $path . 'tasks' . DS . $task.'.php';
|
|
|
|
|
|
|
|
# if (file_exists($taskPath)) {
|
|
|
|
|
|
|
|
# require_once $taskPath;
|
|
|
|
|
|
|
|
# break;
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
|
|
$this->taskNames[] = $taskName;
|
|
|
|
$this->taskNames[] = $taskName;
|
|
|
|
if (!PHP5) {
|
|
|
|
# if (!PHP5) {
|
|
|
|
$this->{$taskName} = new $taskClass($this->Dispatch);
|
|
|
|
# $this->{$taskName} = new $taskClass($this->Dispatch);
|
|
|
|
} else {
|
|
|
|
# } else {
|
|
|
|
$this->{$taskName} = new $taskClass($this->Dispatch);
|
|
|
|
$this->{$taskName} = new $taskClass($this->Dispatch);
|
|
|
|
}
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
|
|
if ($taskName == 'Add') {
|
|
|
|
if ($taskName == 'Add') {
|
|
|
|
$this->{$taskName}->handler_to_use = ucfirst($this->shell) . 'Handler';
|
|
|
|
$this->{$taskName}->handler_to_use = ucfirst($this->shell) . 'Handler';
|
|
|
|