global.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Register The Laravel Class Loader
  5. |--------------------------------------------------------------------------
  6. |
  7. | In addition to using Composer, you may use the Laravel class loader to
  8. | load your controllers and models. This is useful for keeping all of
  9. | your classes in the "global" namespace without Composer updating.
  10. |
  11. */
  12. ClassLoader::addDirectories(array(
  13. app_path().'/commands',
  14. app_path().'/controllers',
  15. app_path().'/models',
  16. app_path().'/database/seeds',
  17. ));
  18. /*
  19. |--------------------------------------------------------------------------
  20. | Application Error Logger
  21. |--------------------------------------------------------------------------
  22. |
  23. | Here we will configure the error logger setup for the application which
  24. | is built on top of the wonderful Monolog library. By default we will
  25. | build a rotating log file setup which creates a new file each day.
  26. |
  27. */
  28. $logFile = 'log-'.php_sapi_name().'.txt';
  29. Log::useDailyFiles(storage_path().'/logs/'.$logFile);
  30. /*
  31. |--------------------------------------------------------------------------
  32. | Application Error Handler
  33. |--------------------------------------------------------------------------
  34. |
  35. | Here you may handle any errors that occur in your application, including
  36. | logging them or displaying custom views for specific errors. You may
  37. | even register several error handlers to handle different types of
  38. | exceptions. If nothing is returned, the default error view is
  39. | shown, which includes a detailed stack trace during debug.
  40. |
  41. */
  42. App::error(function(Exception $exception, $code)
  43. {
  44. Log::error($exception);
  45. });
  46. /*
  47. |--------------------------------------------------------------------------
  48. | Maintenance Mode Handler
  49. |--------------------------------------------------------------------------
  50. |
  51. | The "down" Artisan command gives you the ability to put an application
  52. | into maintenance mode. Here, you will define what is displayed back
  53. | to the user if maintenace mode is in effect for this application.
  54. |
  55. */
  56. App::down(function()
  57. {
  58. return "We'll be right back!";
  59. });
  60. /*
  61. |--------------------------------------------------------------------------
  62. | Require The Filters File
  63. |--------------------------------------------------------------------------
  64. |
  65. | Next we will load the filters file for the application. This gives us
  66. | a nice separate location to store our route and application filter
  67. | definitions instead of putting them all in the main routes file.
  68. |
  69. */
  70. require __DIR__.'/../filters.php';