Exemplo n.º 1
0
Arquivo: Console.php Projeto: jasny/Q
 /**
  * Get method name.
  * 
  * @return string
  */
 protected function getMethod()
 {
     if ($this->method) {
         return $this->method;
     }
     $method = isset($this->methodParam) ? Console::getOpt($this->methodParam) : Console::getArg(isset($this->methodParam) && !isset($this->paramDelim) ? 1 : 0);
     if (isset($this->paramDelim) && !empty($method) && ($pos = strpos($this->paramDelim, $method)) !== false) {
         $method = substr($method, $pos + 1);
     }
     return $method;
 }
Exemplo n.º 2
0
        if (!empty($_GET['mvc'])) {
            $request = explode('/', $_GET['mvc'], 3);
            if (count($request) !== 3) {
                Error::info('URL Error', "HTTP 404!Page Not Found!<P>Error request:<B>{$_SERVER['REQUEST_URI']}</B>");
            }
            $array['controller'] = $request[1];
            $array['view'] = $request[2];
        }
        return $array;
    }
}
while (1) {
    $cmd = Stdio::input('php>');
    if ($cmd[0] === "\\") {
        $cmd = substr($cmd, 1);
        $args = Console::getOpt($cmd);
        switch ($args['args'][0]) {
            case 'q':
            case 'quit':
                echo 'exit console', NL;
                break 2;
            case 'r':
            case 'reload':
                require_ext('runkit');
                //runkit_import();
            //runkit_import();
            case 'e':
            case 'exec':
                $_GET['mvc'] = "/{$args['args'][1]}/{$args['args'][2]}";
                global $php;
                $php->runMVC('mvc');