Refactoring constant definition in laravel.php.
This commit is contained in:
parent
668ecaedd9
commit
75a9591c65
|
@ -1,34 +1,38 @@
|
||||||
<?php namespace System;
|
<?php namespace System;
|
||||||
|
|
||||||
|
// --------------------------------------------------------------
|
||||||
|
// Define the core framework paths.
|
||||||
|
// --------------------------------------------------------------
|
||||||
|
define('APP_PATH', realpath($application).'/');
|
||||||
|
define('SYS_PATH', realpath($system).'/');
|
||||||
|
define('PUBLIC_PATH', realpath($public).'/');
|
||||||
|
define('PACKAGE_PATH', realpath($packages).'/');
|
||||||
|
define('MODULE_PATH', realpath($modules).'/');
|
||||||
|
define('STORAGE_PATH', realpath($storage).'/');
|
||||||
|
define('BASE_PATH', realpath(str_replace('system', '', $system)).'/');
|
||||||
|
|
||||||
|
unset($application, $system, $public, $packages, $modules, $storage);
|
||||||
|
|
||||||
|
// --------------------------------------------------------------
|
||||||
|
// Define various other framework paths.
|
||||||
|
// --------------------------------------------------------------
|
||||||
|
define('CACHE_PATH', STORAGE_PATH.'cache/');
|
||||||
|
define('CONFIG_PATH', APP_PATH.'config/');
|
||||||
|
define('DATABASE_PATH', STORAGE_PATH.'db/');
|
||||||
|
define('LANG_PATH', APP_PATH.'lang/');
|
||||||
|
define('LIBRARY_PATH', APP_PATH.'libraries/');
|
||||||
|
define('MODEL_PATH', APP_PATH.'models/');
|
||||||
|
define('ROUTE_PATH', APP_PATH.'routes/');
|
||||||
|
define('SCRIPT_PATH', PUBLIC_PATH.'js/');
|
||||||
|
define('SESSION_PATH', STORAGE_PATH.'sessions/');
|
||||||
|
define('STYLE_PATH', PUBLIC_PATH.'css/');
|
||||||
|
define('VIEW_PATH', APP_PATH.'views/');
|
||||||
|
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
// Define the PHP file extension.
|
// Define the PHP file extension.
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
define('EXT', '.php');
|
define('EXT', '.php');
|
||||||
|
|
||||||
// --------------------------------------------------------------
|
|
||||||
// Define various other framework paths.
|
|
||||||
// --------------------------------------------------------------
|
|
||||||
$constants = array(
|
|
||||||
'CACHE_PATH' => STORAGE_PATH.'cache/',
|
|
||||||
'CONFIG_PATH' => APP_PATH.'config/',
|
|
||||||
'DATABASE_PATH' => STORAGE_PATH.'db/',
|
|
||||||
'LANG_PATH' => APP_PATH.'lang/',
|
|
||||||
'LIBRARY_PATH' => APP_PATH.'libraries/',
|
|
||||||
'MODEL_PATH' => APP_PATH.'models/',
|
|
||||||
'ROUTE_PATH' => APP_PATH.'routes/',
|
|
||||||
'SCRIPT_PATH' => PUBLIC_PATH.'js/',
|
|
||||||
'SESSION_PATH' => STORAGE_PATH.'sessions/',
|
|
||||||
'STYLE_PATH' => PUBLIC_PATH.'css/',
|
|
||||||
'VIEW_PATH' => APP_PATH.'views/',
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($constants as $key => $value)
|
|
||||||
{
|
|
||||||
define($key, $value);
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($constants, $system);
|
|
||||||
|
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
// Load the classes used by the auto-loader.
|
// Load the classes used by the auto-loader.
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue