Commit 75a9591c authored by Taylor Otwell's avatar Taylor Otwell

Refactoring constant definition in laravel.php.

parent 668ecaed
<?php namespace System; <?php namespace System;
// -------------------------------------------------------------- // --------------------------------------------------------------
// Define the PHP file extension. // Define the core framework paths.
// -------------------------------------------------------------- // --------------------------------------------------------------
define('EXT', '.php'); 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 various other framework paths.
// -------------------------------------------------------------- // --------------------------------------------------------------
$constants = array( define('CACHE_PATH', STORAGE_PATH.'cache/');
'CACHE_PATH' => STORAGE_PATH.'cache/', define('CONFIG_PATH', APP_PATH.'config/');
'CONFIG_PATH' => APP_PATH.'config/', define('DATABASE_PATH', STORAGE_PATH.'db/');
'DATABASE_PATH' => STORAGE_PATH.'db/', define('LANG_PATH', APP_PATH.'lang/');
'LANG_PATH' => APP_PATH.'lang/', define('LIBRARY_PATH', APP_PATH.'libraries/');
'LIBRARY_PATH' => APP_PATH.'libraries/', define('MODEL_PATH', APP_PATH.'models/');
'MODEL_PATH' => APP_PATH.'models/', define('ROUTE_PATH', APP_PATH.'routes/');
'ROUTE_PATH' => APP_PATH.'routes/', define('SCRIPT_PATH', PUBLIC_PATH.'js/');
'SCRIPT_PATH' => PUBLIC_PATH.'js/', define('SESSION_PATH', STORAGE_PATH.'sessions/');
'SESSION_PATH' => STORAGE_PATH.'sessions/', define('STYLE_PATH', PUBLIC_PATH.'css/');
'STYLE_PATH' => PUBLIC_PATH.'css/', define('VIEW_PATH', APP_PATH.'views/');
'VIEW_PATH' => APP_PATH.'views/',
);
foreach ($constants as $key => $value)
{
define($key, $value);
}
unset($constants, $system); // --------------------------------------------------------------
// Define the PHP file extension.
// --------------------------------------------------------------
define('EXT', '.php');
// -------------------------------------------------------------- // --------------------------------------------------------------
// Load the classes used by the auto-loader. // Load the classes used by the auto-loader.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment