added script and style path constants. tweaked router usage in index.php.

This commit is contained in:
Taylor Otwell 2011-07-29 22:53:43 -05:00
parent bc5299abfc
commit f16f90c89c
1 changed files with 8 additions and 2 deletions

View File

@ -23,6 +23,11 @@
// --------------------------------------------------------------
define('BASE_PATH', realpath(str_replace('system', '', $system)).'/');
// --------------------------------------------------------------
// The path to the public directory.
// --------------------------------------------------------------
define('PUBLIC_PATH', realpath(__DIR__).'/');
// --------------------------------------------------------------
// Define various other framework paths.
// --------------------------------------------------------------
@ -34,10 +39,11 @@
'LIBRARY_PATH' => APP_PATH.'libraries/',
'MODEL_PATH' => APP_PATH.'models/',
'PACKAGE_PATH' => APP_PATH.'packages/',
'PUBLIC_PATH' => realpath(__DIR__).'/',
'ROUTE_PATH' => APP_PATH.'routes/',
'SCRIPT_PATH' => PUBLIC_PATH.'js/',
'SESSION_PATH' => APP_PATH.'storage/sessions/',
'STORAGE_PATH' => APP_PATH.'storage/',
'STYLE_PATH' => PUBLIC_PATH.'css/',
'SYS_VIEW_PATH' => SYS_PATH.'views/',
'VIEW_PATH' => APP_PATH.'views/',
);
@ -140,7 +146,7 @@
// ----------------------------------------------------------
if (is_null($response))
{
$route = System\Router::route(System\Request::method(), System\Request::uri());
$route = System\Router::make(System\Request::method(), System\Request::uri())->route();
$response = (is_null($route)) ? System\Response::make(System\View::make('error/404'), 404) : $route->call();
}