Simplify routing

This commit is contained in:
Timothy Warren 2012-05-01 09:39:49 -04:00
parent 4be2e0ee57
commit b4d5ed60ee

View File

@ -232,13 +232,9 @@ function controller_methods($controller)
function route()
{
// Get the equivalent to path info
$pi = (isset($_SERVER['PATH_INFO'])) ? str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['REQUEST_URI']) : NULL;
// Handle default case, without index.php
if(empty($_SERVER['PATH_INFO']))
{
$pi = '/';
}
$pi = (isset($_SERVER['PATH_INFO']))
? str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['REQUEST_URI'])
: '/';
// Load the routes config file
$routes = require_once(MM_APP_PATH.'config/routes.php');