2011-09-19 21:33:25 -05:00
|
|
|
<?php namespace Laravel;
|
|
|
|
|
|
2011-10-18 20:19:36 -05:00
|
|
|
require 'constants.php';
|
2011-09-25 22:25:33 -05:00
|
|
|
|
|
|
|
|
/**
|
2011-09-29 21:22:48 -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-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-09-20 23:14:09 -05:00
|
|
|
require SYS_PATH.'loader'.EXT;
|
2011-09-19 21:33:25 -05:00
|
|
|
|
2011-10-07 16:05:48 -05:00
|
|
|
/**
|
|
|
|
|
* Load some core configuration files by default so we don't have to
|
2011-10-18 21:03:13 -05:00
|
|
|
* let them fall through the Config parser. This will allow us to
|
2011-10-07 16:05:48 -05:00
|
|
|
* load these files faster for each request.
|
|
|
|
|
*/
|
2011-10-18 21:03:13 -05:00
|
|
|
Config::load('application');
|
|
|
|
|
Config::load('container');
|
|
|
|
|
Config::load('session');
|
2011-10-10 21:34:15 -05:00
|
|
|
|
2011-09-25 22:25:33 -05:00
|
|
|
/**
|
2011-09-29 21:22:48 -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-10-10 21:34:15 -05:00
|
|
|
$container = new Container(Config::$items['container']);
|
2011-09-19 21:33:25 -05:00
|
|
|
|
|
|
|
|
IoC::$container = $container;
|
|
|
|
|
|
2011-10-18 21:03:13 -05:00
|
|
|
unset($container);
|
2011-10-10 22:17:22 -05:00
|
|
|
|
2011-09-25 22:25:33 -05:00
|
|
|
/**
|
2011-09-29 21:22:48 -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-10-05 18:32:48 -05:00
|
|
|
spl_autoload_register(array('Laravel\\Loader', 'load'));
|
|
|
|
|
|
2011-10-10 21:34:15 -05:00
|
|
|
Loader::$aliases = Config::$items['application']['aliases'];
|
2011-09-20 21:28:19 -05:00
|
|
|
|
2011-09-25 22:25:33 -05:00
|
|
|
/**
|
2011-10-18 21:03:13 -05:00
|
|
|
* Define a few convenient global functions. These functions primarily
|
|
|
|
|
* exists to provide a short way of accessing functions commonly used
|
|
|
|
|
* in views, allowing the reduction of code noise.
|
2011-09-25 22:25:33 -05:00
|
|
|
*/
|
2011-10-08 22:41:52 -05:00
|
|
|
function e($value)
|
|
|
|
|
{
|
|
|
|
|
return HTML::entities($value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function __($key, $replacements = array(), $language = null)
|
|
|
|
|
{
|
|
|
|
|
return Lang::line($key, $replacements, $language);
|
|
|
|
|
}
|