2011-09-19 21:33:25 -05:00
|
|
|
<?php namespace Laravel;
|
|
|
|
|
|
2011-11-01 22:55:43 -05:00
|
|
|
define('EXT', '.php');
|
|
|
|
|
define('CRLF', chr(13).chr(10));
|
|
|
|
|
define('BLADE_EXT', '.blade.php');
|
2011-09-25 22:25:33 -05:00
|
|
|
|
2011-11-01 22:55:43 -05:00
|
|
|
define('APP_PATH', realpath($application).'/');
|
|
|
|
|
define('BASE_PATH', realpath("$laravel/..").'/');
|
|
|
|
|
define('PUBLIC_PATH', realpath($public).'/');
|
|
|
|
|
define('SYS_PATH', realpath($laravel).'/');
|
|
|
|
|
|
2011-11-01 23:51:14 -05:00
|
|
|
define('STORAGE_PATH', APP_PATH.'storage/');
|
2011-11-01 22:55:43 -05:00
|
|
|
define('CACHE_PATH', STORAGE_PATH.'cache/');
|
|
|
|
|
define('CONFIG_PATH', APP_PATH.'config/');
|
|
|
|
|
define('CONTROLLER_PATH', APP_PATH.'controllers/');
|
|
|
|
|
define('DATABASE_PATH', STORAGE_PATH.'database/');
|
|
|
|
|
define('LANG_PATH', APP_PATH.'language/');
|
|
|
|
|
define('LIBRARY_PATH', APP_PATH.'libraries/');
|
|
|
|
|
define('MODEL_PATH', APP_PATH.'models/');
|
|
|
|
|
define('ROUTE_PATH', APP_PATH.'routes/');
|
|
|
|
|
define('SESSION_PATH', STORAGE_PATH.'sessions/');
|
|
|
|
|
define('SYS_CONFIG_PATH', SYS_PATH.'config/');
|
|
|
|
|
define('SYS_VIEW_PATH', SYS_PATH.'views/');
|
|
|
|
|
define('VIEW_PATH', APP_PATH.'views/');
|
|
|
|
|
|
|
|
|
|
/**
|
2011-11-04 19:07:13 -05:00
|
|
|
* Define the Laravel environment configuration path. This path is used
|
2011-11-09 22:32:35 -06:00
|
|
|
* by the configuration class to load configuration options specific for
|
|
|
|
|
* the server environment, allowing the developer to conveniently change
|
|
|
|
|
* configuration options based on the application environment.
|
|
|
|
|
*
|
2011-11-01 22:55:43 -05:00
|
|
|
*/
|
|
|
|
|
$environment = '';
|
|
|
|
|
|
|
|
|
|
if (isset($_SERVER['LARAVEL_ENV']))
|
|
|
|
|
{
|
|
|
|
|
$environment = CONFIG_PATH.$_SERVER['LARAVEL_ENV'].'/';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
define('ENV_CONFIG_PATH', $environment);
|
|
|
|
|
|
2011-11-01 23:51:14 -05:00
|
|
|
unset($application, $public, $laravel, $environment);
|
2011-11-01 22:55:43 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Require all of the classes that can't be loaded by the auto-loader.
|
|
|
|
|
* These are typically classes that the auto-loader itself relies upon
|
|
|
|
|
* to load classes, such as the array and configuration classes.
|
|
|
|
|
*/
|
2011-10-18 20:19:36 -05:00
|
|
|
require SYS_PATH.'arr'.EXT;
|
2011-09-19 21:33:25 -05:00
|
|
|
require SYS_PATH.'config'.EXT;
|
2011-11-08 20:08:20 -06:00
|
|
|
require SYS_PATH.'facades'.EXT;
|
2011-10-31 22:15:47 -05:00
|
|
|
require SYS_PATH.'autoloader'.EXT;
|
2011-09-19 21:33:25 -05:00
|
|
|
|
2011-11-01 22:55:43 -05:00
|
|
|
/**
|
2011-11-04 19:07:13 -05:00
|
|
|
* Load a few of the core configuration files that are loaded for every
|
|
|
|
|
* request to the application. It is quicker to load them manually each
|
|
|
|
|
* request rather than parse the keys for every request.
|
2011-11-01 22:55:43 -05:00
|
|
|
*/
|
2011-10-18 21:03:13 -05:00
|
|
|
Config::load('application');
|
|
|
|
|
Config::load('session');
|
2011-10-10 21:34:15 -05:00
|
|
|
|
2011-11-01 22:55:43 -05:00
|
|
|
/**
|
|
|
|
|
* Register the Autoloader's "load" method on the auto-loader stack.
|
|
|
|
|
* This method provides the lazy-loading of all class files, as well
|
|
|
|
|
* as any PSR-0 compliant libraries used by the application.
|
|
|
|
|
*/
|
2011-10-31 23:58:45 -05:00
|
|
|
spl_autoload_register(array('Laravel\\Autoloader', 'load'));
|
2011-09-20 21:28:19 -05:00
|
|
|
|
2011-11-01 22:55:43 -05:00
|
|
|
/**
|
2011-11-04 19:07:13 -05:00
|
|
|
* Define a few global convenience functions to make our lives as
|
|
|
|
|
* Laravel PHP developers a little more easy and enjoyable.
|
2011-11-01 22:55:43 -05:00
|
|
|
*/
|
2011-11-10 22:10:18 -06:00
|
|
|
require SYS_PATH.'helpers'.EXT;
|