= 0) { $start = microtime(true); ob_start(); $this->clear_global(); performance_helper::clear(); http_header::instance()->start(); try { Log::start_sql_log(); $this->parase_requri(); init_request(); init_cookie($_SERVER['HTTP_COOKIE']); $file = request_helper::script_file(); if(file_exists($file)) { if(defined('CROSS_DOAMIN') && CROSS_DOAMIN == true) { $host = 'http://localhost:3333'; fcgi_header("Content-Type: text/html; charset=UTF-8"); fcgi_header("Access-Control-Allow-Credentials: true"); fcgi_header("Access-Control-Allow-Origin: {$host}"); fcgi_header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE,PATCH'); } if(self::is_exclude($file)) { include $file; } else { if(!isset($_GET['act'])) { $_GET['act'] = 'index'; } if(!isset($_GET['op'])) { $_GET['op'] = 'index'; } if(!isset($_POST['act'])) { $_POST['act'] = 'index'; } if(!isset($_POST['op'])) { $_POST['op'] = 'index'; } //部分控制器不需要使用session. $act = $_GET['act']; if($act != 'refill') { session::instance()->start(); Log::record("member_id=" . session_helper::memberid(),Log::DEBUG); } Base::mobile_control(); } } else { fcgi_header("Content-Type: text/html; charset=UTF-8"); echo "no such file."; } } catch (UnloginException $ex) { mobileControl::outerr(errcode::ErrUnLogin,errcode::msg(errcode::ErrUnLogin)); } catch (Exception $ex) { mobileControl::outerr($ex->getCode(),$ex->getMessage()); Log::record("run_looper exception catch code={$ex->getCode()} msg={$ex->getMessage()} trace={$ex->getTraceAsString()}",Log::ERR); } session::instance()->end(); fcgi_headers_sent(); $contents = ob_get_clean(); fcgi_echo($contents); Log::end_sql_log(); Log::record("content={$contents}",Log::DEBUG); //fcgi_finish();//单线程的情况下不需要调用 $msg = sprintf("request time=%.6f\r\n\r\n",microtime(true) - $start); // Log::record($msg ,Log::DEBUG); } fcgi_fini(); Log::record('Waiting quit......',Log::DEBUG); } }