Exemplo n.º 1
0
 /**
  * 初始化请求的路由字符串
  */
 protected static function initRouterUrl()
 {
     $os_type = strtoupper(PHP_OS);
     if (strpos($os_type, 'WIN') !== false) {
         $arr = Request::request()->get();
         self::$router_url = isset($arr['__QP_url']) ? $arr['__QP_url'] : '';
         return;
     }
     if (strpos($os_type, 'LINUX') !== false) {
         $uri = Request::request()->getURI();
         $pos = strpos($uri, '?');
         if ($pos !== false) {
             $uri = substr($uri, 0, $pos);
         }
         $uri = str_replace("\\", "/", $uri);
         while (true) {
             $tmp = str_replace("//", "/", $uri);
             if ($tmp === $uri) {
                 break;
             }
             $uri = $tmp;
         }
         self::$router_url = $uri;
         return;
     }
     self::$router_url = "";
 }