From 28fbd35491d7e05a7dd400427b63ca595bbfc572 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 28 Jul 2011 08:56:39 -0500 Subject: [PATCH] Clean up constant handling and definition. --- public/index.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/index.php b/public/index.php index 3d17824a..39acc45b 100644 --- a/public/index.php +++ b/public/index.php @@ -11,18 +11,22 @@ // -------------------------------------------------------------- // The path to the application directory. // -------------------------------------------------------------- -define('APP_PATH', realpath('../application').'/'); +define('APP_PATH', realpath($application = '../application').'/'); // -------------------------------------------------------------- // The path to the system directory. // -------------------------------------------------------------- -define('SYS_PATH', realpath('../system').'/'); +define('SYS_PATH', realpath($system = '../system').'/'); + +// -------------------------------------------------------------- +// The path to the directory containing the system directory. +// -------------------------------------------------------------- +define('BASE_PATH', realpath(str_replace('system', '', $system)).'/'); // -------------------------------------------------------------- // Define various other framework paths. // -------------------------------------------------------------- $constants = array( - 'BASE_PATH' => realpath('../').'/', 'CACHE_PATH' => APP_PATH.'storage/cache/', 'CONFIG_PATH' => APP_PATH.'config/', 'DATABASE_PATH' => APP_PATH.'storage/db/', @@ -43,7 +47,7 @@ define($key, $value); } -unset($constants); +unset($constants, $application, $system); // -------------------------------------------------------------- // Define the PHP file extension.