From f16f90c89ca324a3ea02ead010cb21ae61154f54 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 29 Jul 2011 22:53:43 -0500 Subject: [PATCH] added script and style path constants. tweaked router usage in index.php. --- public/index.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public/index.php b/public/index.php index 50ca810f..9f578faf 100644 --- a/public/index.php +++ b/public/index.php @@ -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(); }