123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <?php
- /*
- |--------------------------------------------------------------------------
- | PHP Display Errors Configuration
- |--------------------------------------------------------------------------
- |
- | Since Laravel intercepts and displays all errors with a detailed stack
- | trace, we can turn off the display_errors ini directive. However, you
- | may want to enable this option if you ever run into a dreaded white
- | screen of death, as it can provide some clues.
- |
- */
- ini_set('display_errors', 'Off');
- /*
- |--------------------------------------------------------------------------
- | Laravel Configuration Loader
- |--------------------------------------------------------------------------
- |
- | The Laravel configuration loader is responsible for returning an array
- | of configuration options for a given bundle and file. By default, we
- | use the files provided with Laravel; however, you are free to use
- | your own storage mechanism for configuration arrays.
- |
- */
- Laravel\Event::listen(Laravel\Config::loader, function($bundle, $file)
- {
- return Laravel\Config::file($bundle, $file);
- });
- /*
- |--------------------------------------------------------------------------
- | Register Class Aliases
- |--------------------------------------------------------------------------
- |
- | Aliases allow you to use classes without always specifying their fully
- | namespaced path. This is convenient for working with any library that
- | makes a heavy use of namespace for class organization. Here we will
- | simply register the configured class aliases.
- |
- */
- $aliases = Laravel\Config::get('application.aliases');
- Laravel\Autoloader::$aliases = $aliases;
- /*
- |--------------------------------------------------------------------------
- | Laravel View Loader
- |--------------------------------------------------------------------------
- |
- | The Laravel view loader is responsible for returning the full file path
- | for the given bundle and view. Of course, a default implementation is
- | provided to load views according to typical Laravel conventions but
- | you may change this to customize how your views are organized.
- |
- */
- Event::listen(View::loader, function($bundle, $view)
- {
- return View::file($bundle, $view);
- });
- /*
- |--------------------------------------------------------------------------
- | Laravel Language Loader
- |--------------------------------------------------------------------------
- |
- | The Laravel language loader is responsible for returning the array of
- | language lines for a given bundle, language, and "file". A default
- | implementation has been provided which uses the default language
- | directories included with Laravel. However, you may tweak this
- | method to laad your language arrays however you wish.
- |
- */
- Event::listen(Lang::loader, function($bundle, $language, $file)
- {
- return Lang::file($bundle, $language, $file);
- });
- /*
- |--------------------------------------------------------------------------
- | Set The Default Timezone
- |--------------------------------------------------------------------------
- |
- | We need to set the default timezone for the application. This controls
- | the timezone that will be used by any of the date methods and classes
- | utilized by Laravel or your application. The timezone may be set in
- | your application configuration file.
- |
- */
- date_default_timezone_set(Config::get('application.timezone'));
- /*
- |--------------------------------------------------------------------------
- | Start / Load The User Session
- |--------------------------------------------------------------------------
- |
- | Sessions allow the web, which is stateless, to simulate state. In other
- | words, sessions allow you to store information about the current user
- | and state of your application. Here we'll just fire up the session
- | if a session driver has been configured.
- |
- */
- if (Config::get('session.driver') !== '')
- {
- Session::load();
- }
- /*
- |--------------------------------------------------------------------------
- | Auto-Loader Mappings
- |--------------------------------------------------------------------------
- |
- | Laravel uses a simple array of class to path mappings to drive the class
- | auto-loader. This simple approach helps avoid the performance problems
- | of searching through directories by convention.
- |
- | Registering a mapping couldn't be easier. Just pass an array of class
- | to path maps into the "map" function of Autoloader. Then, when you
- | want to use that class, just use it. It's simple!
- |
- */
- Autoloader::map(array(
- 'Base_Controller' => path('app').'controllers/base.php',
- ));
- /*
- |--------------------------------------------------------------------------
- | Auto-Loader Directories
- |--------------------------------------------------------------------------
- |
- | The Laravel auto-loader can search directories for files using the PSR-0
- | naming convention. This convention basically organizes classes by using
- | the class namespace to indicate the directory structure.
- |
- | So you don't have to manually map all of your models, we've added the
- | models and libraries directories for you. So, you can model away and
- | the auto-loader will take care of the rest.
- |
- */
- Autoloader::directories(array(
- path('app').'models',
- path('app').'libraries',
- ));
|