public function __call($name, $args)
    {/*{{{*/
		/*
        $agent = getenv('HTTP_USER_AGENT');
        if(false === strpos(strtolower($agent), 'haodf_app') && URL_PREFIX != 'dev.')
        {
            header("404 Not Found");
            header('Location: http://www.haodf.com/404/404.php');
            exit;
        }
		*/
        //模拟2g网络链接 3成延迟3~5秒 7成延迟1到3秒
        // var_dump(URL_PREFIX);
        if(URL_PREFIX == "dev.")
        {
       //      $this->sleepResponse();
        }
        $scriptNames = explode('/', $_SERVER['REQUEST_URI']);
        $appName = $scriptNames[1];
    	$args[1]->info = MobileApi::getInstance($args[0])->run($args[0], $appName);
    	//在mywebapp中FixedRouterRule中加了templates指向到/mobileapi/view
    	return parent::SUCCESS;
    }/*}}}*/
Ejemplo n.º 2
0
 public function getLatestAPIVersion($os)
 {/*{{{*/
     $version = MobileApi::getLastAPIVersion($os);
     if (false == $version)
     {
         $this->setErrorCode(121);
         return 0;
     }
     $this->content = array('version' => $version);
 }/*}}}*/