public function execute($exec_args) { /* * The first item is always the filename. */ array_shift($exec_args); $this->parseExecArgs($exec_args); // This will do for now, but really this should be wrapped in a class // and all actions should register themselves with that class. if (isset($exec_args) && count($exec_args) > 0) { $action = array_shift($exec_args); $args = $exec_args; if ($action_info = TaskRunner::parseActionInfo($action)) { list($obj, $file) = $action_info; } } if (!isset($obj)) { $action = 'help'; if ($action_info = TaskRunner::parseActionInfo($action)) { list($obj, $file) = $action_info; } $args = array(); } $this->action = $action; require_once $file; print $this->preFormat(); $action_object = new $obj(array('options' => &$this->options)); print $this->postFormat($action_object->execute($args)); }
public function showHelp($args = array()) { if ($action_info = TaskRunner::parseActionInfo($args[0])) { list($obj, $file) = $action_info; } if (isset($obj)) { require_once $file; return $obj::getHelp(); } }