From 3516334ec7907b52e50501d4a6079483d8698e0d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 28 Jul 2011 08:46:39 -0500 Subject: [PATCH] Clean up constant definitions. --- public/index.php | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/public/index.php b/public/index.php index 73b521bf..3d17824a 100644 --- a/public/index.php +++ b/public/index.php @@ -9,28 +9,41 @@ */ // -------------------------------------------------------------- -// Define the core framework paths. +// The path to the application directory. // -------------------------------------------------------------- define('APP_PATH', realpath('../application').'/'); + +// -------------------------------------------------------------- +// The path to the system directory. +// -------------------------------------------------------------- define('SYS_PATH', realpath('../system').'/'); -define('PUBLIC_PATH', realpath(__DIR__.'/')); -define('BASE_PATH', realpath('../').'/'); // -------------------------------------------------------------- // Define various other framework paths. // -------------------------------------------------------------- -define('CACHE_PATH', APP_PATH.'storage/cache/'); -define('CONFIG_PATH', APP_PATH.'config/'); -define('DATABASE_PATH', APP_PATH.'storage/db/'); -define('LANG_PATH', APP_PATH.'lang/'); -define('LIBRARY_PATH', APP_PATH.'libraries/'); -define('MODEL_PATH', APP_PATH.'models/'); -define('PACKAGE_PATH', APP_PATH.'packages/'); -define('ROUTE_PATH', APP_PATH.'routes/'); -define('SESSION_PATH', APP_PATH.'storage/sessions/'); -define('STORAGE_PATH', APP_PATH.'storage/'); -define('SYS_VIEW_PATH', SYS_PATH.'views/'); -define('VIEW_PATH', APP_PATH.'views/'); +$constants = array( + 'BASE_PATH' => realpath('../').'/', + 'CACHE_PATH' => APP_PATH.'storage/cache/', + 'CONFIG_PATH' => APP_PATH.'config/', + 'DATABASE_PATH' => APP_PATH.'storage/db/', + 'LANG_PATH' => APP_PATH.'lang/', + 'LIBRARY_PATH' => APP_PATH.'libraries/', + 'MODEL_PATH' => APP_PATH.'models/', + 'PACKAGE_PATH' => APP_PATH.'packages/', + 'PUBLIC_PATH' => realpath(__DIR__).'/', + 'ROUTE_PATH' => APP_PATH.'routes/', + 'SESSION_PATH' => APP_PATH.'storage/sessions/', + 'STORAGE_PATH' => APP_PATH.'storage/', + 'SYS_VIEW_PATH' => SYS_PATH.'views/', + 'VIEW_PATH' => APP_PATH.'views/', +); + +foreach ($constants as $key => $value) +{ + define($key, $value); +} + +unset($constants); // -------------------------------------------------------------- // Define the PHP file extension.