public function init($mode = null)
{
$parser = new Parser($this->_request);
$parser->init($mode);
/* run command */
$commandKey = $parser->getArgument(0);
if (array_key_exists($commandKey, $this->_namespaceArray)) {
$commandClass = $this->_namespaceArray[$commandKey];
if (class_exists($commandClass)) {
$command = new $commandClass($this->_registry, $this->_request, $this->_config);
return $command->run($mode);
}
}
return false;
}
/** * console line * * @since 3.0.0 * * @return string */ public static function consoleLine() { $console = new Console\Console(Registry::getInstance(), Request::getInstance(), Config::getInstance()); $output = $console->init('template'); if (is_string($output)) { return htmlentities($output); } }