Refactor the request class.

This commit is contained in:
Taylor Otwell 2011-08-08 09:44:10 -05:00
parent 3d684136b8
commit 88ebf6125c
1 changed files with 4 additions and 8 deletions

View File

@ -29,15 +29,11 @@ public static function uri()
$uri = static::raw_uri();
if (strpos($uri, $base = parse_url(Config::get('application.url'), PHP_URL_PATH)) === 0)
{
$uri = substr($uri, strlen($base));
}
$base = parse_url(Config::get('application.url'), PHP_URL_PATH);
if (strpos($uri, $index = '/index.php') === 0)
{
$uri = substr($uri, strlen($index));
}
if (strpos($uri, $base) === 0) $uri = substr($uri, strlen($base));
if (strpos($uri, $index = '/index.php') === 0) $uri = substr($uri, strlen($index));
return static::$uri = (($uri = trim($uri, '/')) == '') ? '/' : $uri;
}