2011-09-19 21:33:25 -05:00
|
|
|
<?php namespace Laravel;
|
|
|
|
|
|
|
|
|
|
define('APP_PATH', realpath($application).'/');
|
|
|
|
|
define('BASE_PATH', realpath(str_replace('laravel', '', $laravel)).'/');
|
|
|
|
|
define('PACKAGE_PATH', realpath($packages).'/');
|
|
|
|
|
define('PUBLIC_PATH', realpath($public).'/');
|
|
|
|
|
define('STORAGE_PATH', realpath($storage).'/');
|
|
|
|
|
define('SYS_PATH', realpath($laravel).'/');
|
|
|
|
|
|
|
|
|
|
unset($laravel, $application, $config, $packages, $public, $storage);
|
|
|
|
|
|
|
|
|
|
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/');
|
2011-09-27 21:10:32 -05:00
|
|
|
define('LIBRARY_PATH', APP_PATH.'libraries/');
|
|
|
|
|
define('MODEL_PATH', APP_PATH.'models/');
|
2011-09-19 21:33:25 -05:00
|
|
|
define('ROUTE_PATH', APP_PATH.'routes/');
|
|
|
|
|
define('SESSION_PATH', STORAGE_PATH.'sessions/');
|
|
|
|
|
define('SYS_CONFIG_PATH', SYS_PATH.'config/');
|
|
|
|
|
define('SYS_LANG_PATH', SYS_PATH.'language/');
|
|
|
|
|
define('VIEW_PATH', APP_PATH.'views/');
|
|
|
|
|
|
2011-09-28 21:52:58 -05:00
|
|
|
define('EXT', '.php');
|
2011-09-25 22:25:33 -05:00
|
|
|
define('BLADE_EXT', '.blade.php');
|
|
|
|
|
|
|
|
|
|
/**
|
2011-09-25 22:29:23 -05:00
|
|
|
* Load the classes that can't be resolved through the auto-loader. These are typically classes
|
|
|
|
|
* that are used by the auto-loader or configuration classes, and therefore cannot be auto-loaded.
|
2011-09-25 22:25:33 -05:00
|
|
|
*/
|
2011-09-19 21:33:25 -05:00
|
|
|
require SYS_PATH.'facades'.EXT;
|
|
|
|
|
require SYS_PATH.'config'.EXT;
|
2011-09-20 23:14:09 -05:00
|
|
|
require SYS_PATH.'loader'.EXT;
|
2011-09-19 21:33:25 -05:00
|
|
|
require SYS_PATH.'arr'.EXT;
|
|
|
|
|
|
2011-09-25 22:25:33 -05:00
|
|
|
/**
|
2011-09-25 22:29:23 -05:00
|
|
|
* Bootstrap the application inversion of control (IoC) container. The container provides the
|
|
|
|
|
* convenient resolution of objects and their dependencies, allowing for flexibility and
|
|
|
|
|
* testability within the framework and application.
|
2011-09-25 22:25:33 -05:00
|
|
|
*/
|
2011-09-20 23:14:09 -05:00
|
|
|
require SYS_PATH.'container'.EXT;
|
2011-09-19 21:33:25 -05:00
|
|
|
|
2011-09-20 23:14:09 -05:00
|
|
|
$container = new Container(Config::get('container'));
|
2011-09-19 21:33:25 -05:00
|
|
|
|
|
|
|
|
IoC::$container = $container;
|
|
|
|
|
|
2011-09-25 22:25:33 -05:00
|
|
|
/**
|
2011-09-25 22:29:23 -05:00
|
|
|
* Register the application auto-loader. The auto-loader is responsible for the lazy-loading
|
|
|
|
|
* of all of the Laravel core classes, as well as the developer created libraries and models.
|
2011-09-25 22:25:33 -05:00
|
|
|
*/
|
2011-09-27 21:10:32 -05:00
|
|
|
spl_autoload_register(array($container->resolve('laravel.loader'), 'load'));
|
2011-09-20 21:28:19 -05:00
|
|
|
|
2011-09-25 22:25:33 -05:00
|
|
|
/**
|
|
|
|
|
* Define a few convenient global functions.
|
|
|
|
|
*/
|
2011-09-20 21:28:19 -05:00
|
|
|
function e($value)
|
|
|
|
|
{
|
2011-09-20 23:14:09 -05:00
|
|
|
return HTML::entities($value);
|
2011-09-20 21:28:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function __($key, $replacements = array(), $language = null)
|
|
|
|
|
{
|
2011-09-20 23:14:09 -05:00
|
|
|
return Lang::line($key, $replacements, $language);
|
2011-09-28 22:25:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function fe($function)
|
|
|
|
|
{
|
|
|
|
|
return function_exists($function);
|
2011-09-20 21:28:19 -05:00
|
|
|
}
|