Example #1
0
 public static function __constructStatic()
 {
     if (!Lobby::$cli) {
         self::$requestURI = $_SERVER['REQUEST_URI'];
         /**
          * Make the request URL relative to the base URL of Lobby installation.
          * http://localhost/lobby will be changed to "/"
          * and http://lobby.local to "/"
          * ---------------------
          * We do this directly to $_SERVER['REQUEST_URI'] because, Klein (router)
          * obtains the value from it. Hence we keep the original value in self::$requestURI
          */
         $lobbyBase = str_replace(str_replace("\\", "/", $_SERVER['DOCUMENT_ROOT']), "", L_DIR);
         $lobbyBase = substr($lobbyBase, 0) == "/" ? substr_replace($lobbyBase, "", 0) : $lobbyBase;
         $_SERVER['REQUEST_URI'] = str_replace($lobbyBase, "", $_SERVER['REQUEST_URI']);
         $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], -1) == "/" && $_SERVER['REQUEST_URI'] != "/" ? substr_replace($_SERVER['REQUEST_URI'], "", -1) : $_SERVER['REQUEST_URI'];
     }
     self::$request = new SymRequest($_GET, $_POST, array(), array(), $_FILES, $_SERVER);
 }