start.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Create The Application
  5. |--------------------------------------------------------------------------
  6. |
  7. | The first thing we will do is create a new Laravel application instance
  8. | which serves as the "glue" for all the components of Laravel, and is
  9. | the IoC container for the system binding all of the various parts.
  10. |
  11. */
  12. $app = new Illuminate\Foundation\Application;
  13. /*
  14. |--------------------------------------------------------------------------
  15. | Bind Paths
  16. |--------------------------------------------------------------------------
  17. |
  18. | Here we are binding the paths configured in paths.php to the app. You
  19. | should not be changing these here but rather in paths.php.
  20. |
  21. */
  22. $paths = require __DIR__.'/paths.php';
  23. $app->instance('path', $appPath = $paths['app']);
  24. $app->instance('path.base', $paths['base']);
  25. $app->instance('path.public', $paths['public']);
  26. /*
  27. |--------------------------------------------------------------------------
  28. | Detect The Application Environment
  29. |--------------------------------------------------------------------------
  30. |
  31. | Laravel takes a dead simple approach to your application environments
  32. | so you can just specify a machine name or HTTP host that matches a
  33. | given environment, then we will automatically detect it for you.
  34. |
  35. */
  36. $env = $app->detectEnvironment(array(
  37. 'local' => array('your-machine-name'),
  38. ));
  39. /*
  40. |--------------------------------------------------------------------------
  41. | Load The Application
  42. |--------------------------------------------------------------------------
  43. |
  44. | Here we will load the Illuminate application. We'll keep this is in a
  45. | separate location so we can isolate the creation of an application
  46. | from the actual running of the application with a given request.
  47. |
  48. */
  49. require $app->getBootstrapFile();
  50. /*
  51. |--------------------------------------------------------------------------
  52. | Return The Application
  53. |--------------------------------------------------------------------------
  54. |
  55. | This script returns the application instance. The instance is given to
  56. | the calling script so we can separate the building of the instances
  57. | from the actual running of the application and sending responses.
  58. |
  59. */
  60. return $app;