start.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. | Register Class Aliases
  17. |--------------------------------------------------------------------------
  18. |
  19. | Aliases allow you to use classes without always specifying their fully
  20. | namespaced path. This is convenient for working with any library that
  21. | makes a heavy use of namespace for class organization. Here we will
  22. | simply register the configured class aliases.
  23. |
  24. */
  25. $aliases = Laravel\Config::get('application.aliases');
  26. Laravel\Autoloader::$aliases = $aliases;
  27. /*
  28. |--------------------------------------------------------------------------
  29. | Set The Default Timezone
  30. |--------------------------------------------------------------------------
  31. |
  32. | We need to set the default timezone for the application. This controls
  33. | the timezone that will be used by any of the date methods and classes
  34. | utilized by Laravel or your application. The timezone may be set in
  35. | your application configuration file.
  36. |
  37. */
  38. date_default_timezone_set(Config::get('application.timezone'));
  39. /*
  40. |--------------------------------------------------------------------------
  41. | Start / Load The User Session
  42. |--------------------------------------------------------------------------
  43. |
  44. | Sessions allow the web, which is stateless, to simulate state. In other
  45. | words, sessions allow you to store information about the current user
  46. | and state of your application. Here we'll just fire up the session
  47. | if a session driver has been configured.
  48. |
  49. */
  50. if (Config::get('session.driver') !== '')
  51. {
  52. Session::load();
  53. }
  54. /*
  55. |--------------------------------------------------------------------------
  56. | Auto-Loader Mappings
  57. |--------------------------------------------------------------------------
  58. |
  59. | Laravel uses a simple array of class to path mappings to drive the class
  60. | auto-loader. This simple approach helps avoid the performance problems
  61. | of searching through directories by convention.
  62. |
  63. | Registering a mapping couldn't be easier. Just pass an array of class
  64. | to path maps into the "map" function of Autoloader. Then, when you
  65. | want to use that class, just use it. It's simple!
  66. |
  67. */
  68. Autoloader::map(array(
  69. 'Base_Controller' => path('app').'controllers/base.php',
  70. ));
  71. /*
  72. |--------------------------------------------------------------------------
  73. | Auto-Loader Directories
  74. |--------------------------------------------------------------------------
  75. |
  76. | The Laravel auto-loader can search directories for files using the PSR-0
  77. | naming convention. This convention basically organizes classes by using
  78. | the class namespace to indicate the directory structure.
  79. |
  80. | So you don't have to manually map all of your models, we've added the
  81. | models and libraries directories for you. So, you can model away and
  82. | the auto-loader will take care of the rest.
  83. |
  84. */
  85. Autoloader::directories(array(
  86. path('app').'models',
  87. path('app').'libraries',
  88. ));