start.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. | Define The Application Path
  16. |--------------------------------------------------------------------------
  17. |
  18. | Here we just defined the path to the application directory. Most likely
  19. | you will never need to change this value as the default setup should
  20. | work perfectly fine for the vast majority of all our applications.
  21. |
  22. */
  23. $app->instance('path', $appPath = __DIR__.'/app');
  24. $app->instance('path.base', __DIR__);
  25. /*
  26. |--------------------------------------------------------------------------
  27. | Detect The Application Environment
  28. |--------------------------------------------------------------------------
  29. |
  30. | Laravel takes a dead simple approach to your application environments
  31. | so you can just specify a machine name or HTTP host that matches a
  32. | given environment, then we will automatically detect it for you.
  33. |
  34. */
  35. $env = $app->detectEnvironment(array(
  36. 'local' => array('your-machine-name'),
  37. ));
  38. /*
  39. |--------------------------------------------------------------------------
  40. | Load The Application
  41. |--------------------------------------------------------------------------
  42. |
  43. | Here we will load the Illuminate application. We'll keep this is in a
  44. | separate location so we can isolate the creation of an application
  45. | from the actual running of the application with a given request.
  46. |
  47. */
  48. require $app->getBootstrapFile();
  49. /*
  50. |--------------------------------------------------------------------------
  51. | Return The Application
  52. |--------------------------------------------------------------------------
  53. |
  54. | This script returns the application instance. The instance is given to
  55. | the calling script so we can separate the building of the instances
  56. | from the actual running of the application and sending responses.
  57. |
  58. */
  59. return $app;