Example #1
0
 /** 
  * Gets a request object for the current request. Parses PATH_INFO as necessary.
  * @return Request
  */
 public static function get()
 {
     static $req;
     if (!isset($req)) {
         $path = false;
         if (defined('SERVER_PATH_VARIABLE')) {
             $path = Request::parsePathFromRequest(SERVER_PATH_VARIABLE);
         }
         if (!$path) {
             $path = Request::parsePathFromRequest('ORIG_PATH_INFO');
         }
         if (!$path) {
             $path = Request::parsePathFromRequest('PATH_INFO');
         }
         /*
         			if (!$path) {
         				$path = Request::parsePathFromRequest('REQUEST_URI');
         			}*/
         if (!$path) {
             $path = Request::parsePathFromRequest('SCRIPT_NAME');
         }
         if (!$path) {
             $path = Request::parsePathFromRequest('REDIRECT_URL');
         }
         $req = new Request($path);
     }
     return $req;
 }