start.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | PHP Display Errors Configuration
  5. |--------------------------------------------------------------------------
  6. |
  7. | Since Laravel intercepts and displays all errors with a detailed stack
  8. | trace, we can turn off the display_errors ini directive. However, you
  9. | may want to enable this option if you ever run into a dreaded white
  10. | screen of death, as it can provide some clues.
  11. |
  12. */
  13. ini_set('display_errors', 'Off');
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Laravel Configuration Loader
  17. |--------------------------------------------------------------------------
  18. |
  19. | The Laravel configuration loader is responsible for returning an array
  20. | of configuration options for a given bundle and file. By default, we
  21. | use the files provided with Laravel; however, you are free to use
  22. | your own storage mechanism for configuration arrays.
  23. |
  24. */
  25. Laravel\Event::listen(Laravel\Config::loader, function($bundle, $file)
  26. {
  27. return Laravel\Config::file($bundle, $file);
  28. });
  29. /*
  30. |--------------------------------------------------------------------------
  31. | Register Class Aliases
  32. |--------------------------------------------------------------------------
  33. |
  34. | Aliases allow you to use classes without always specifying their fully
  35. | namespaced path. This is convenient for working with any library that
  36. | makes a heavy use of namespace for class organization. Here we will
  37. | simply register the configured class aliases.
  38. |
  39. */
  40. $aliases = Laravel\Config::get('application.aliases');
  41. Laravel\Autoloader::$aliases = $aliases;
  42. /*
  43. |--------------------------------------------------------------------------
  44. | Set The Default Timezone
  45. |--------------------------------------------------------------------------
  46. |
  47. | We need to set the default timezone for the application. This controls
  48. | the timezone that will be used by any of the date methods and classes
  49. | utilized by Laravel or your application. The timezone may be set in
  50. | your application configuration file.
  51. |
  52. */
  53. date_default_timezone_set(Config::get('application.timezone'));
  54. /*
  55. |--------------------------------------------------------------------------
  56. | Start / Load The User Session
  57. |--------------------------------------------------------------------------
  58. |
  59. | Sessions allow the web, which is stateless, to simulate state. In other
  60. | words, sessions allow you to store information about the current user
  61. | and state of your application. Here we'll just fire up the session
  62. | if a session driver has been configured.
  63. |
  64. */
  65. if (Config::get('session.driver') !== '')
  66. {
  67. Session::load();
  68. }
  69. /*
  70. |--------------------------------------------------------------------------
  71. | Auto-Loader Mappings
  72. |--------------------------------------------------------------------------
  73. |
  74. | Laravel uses a simple array of class to path mappings to drive the class
  75. | auto-loader. This simple approach helps avoid the performance problems
  76. | of searching through directories by convention.
  77. |
  78. | Registering a mapping couldn't be easier. Just pass an array of class
  79. | to path maps into the "map" function of Autoloader. Then, when you
  80. | want to use that class, just use it. It's simple!
  81. |
  82. */
  83. Autoloader::map(array(
  84. 'Base_Controller' => path('app').'controllers/base.php',
  85. ));
  86. /*
  87. |--------------------------------------------------------------------------
  88. | Auto-Loader Directories
  89. |--------------------------------------------------------------------------
  90. |
  91. | The Laravel auto-loader can search directories for files using the PSR-0
  92. | naming convention. This convention basically organizes classes by using
  93. | the class namespace to indicate the directory structure.
  94. |
  95. | So you don't have to manually map all of your models, we've added the
  96. | models and libraries directories for you. So, you can model away and
  97. | the auto-loader will take care of the rest.
  98. |
  99. */
  100. Autoloader::directories(array(
  101. path('app').'models',
  102. path('app').'libraries',
  103. ));