예제 #1
0
파일: CxBug.php 프로젝트: cloklo/CxWoole
 private static function _clear()
 {
     self::$sql = null;
     self::$log = null;
     self::$start = null;
     self::$time = null;
     self::$server = null;
     self::$exception = null;
     self::$session = null;
     //self::$show;
     //self::$key;
 }
예제 #2
0
파일: CxSwoole.php 프로젝트: cloklo/CxWoole
 public function onRequest($request, $response)
 {
     try {
         CxBug::start();
         $this->request = $request;
         $this->response = $response;
         $_COOKIE = isset($request->cookie) ? $request->cookie : array();
         $_GET = isset($request->get) ? $request->get : array();
         $_POST = isset($request->post) ? $request->post : array();
         $_REQUEST = array_merge($_GET, $_POST);
         $_SERVER = array_merge($request->header, $request->server);
         SWOOLE_ENABLE_GZIP and $response->gzip(SWOOLE_ENABLE_GZIP);
         ob_start();
         $url = new CxRouter($request->server['path_info']);
         if ($url->getController() == 'debug') {
             $this->_doBug($url);
         } else {
             $this->redirect and call_user_func($this->redirect, $url);
             $this->_doWith($url);
             $this->_onEnd();
         }
     } catch (Exception $e) {
         //因为需要模拟die函数,所以此处需要catch处理
     }
     $response->end(ob_get_contents());
     ob_end_clean();
 }