/** * shell构造参数 * @return array */ public function getArgs() { global $argv, $argc; //构造参数 $params = ['args' => [], 'params' => []]; $params['args'] = $argc > 1 ? array_slice($argv, 2) : []; foreach ($params['args'] as $k => $param) { if (preg_match_all("/--([\\w_]+)=(.*)/", $param, $matchs)) { $params['params'][$matchs[1][0]] = $matchs[2][0]; unset($params['args'][$k]); } } $params['args'] = array_values($params['args']); self::$ARGS = $params['params']; return $params; }
/** * router */ private function router() { $this->router->router(); }