start.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. $app->redirectIfTrailingSlash();
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Detect The Application Environment
  17. |--------------------------------------------------------------------------
  18. |
  19. | Laravel takes a dead simple approach to your application environments
  20. | so you can just specify a machine name or HTTP host that matches a
  21. | given environment, then we will automatically detect it for you.
  22. |
  23. */
  24. $env = $app->detectEnvironment(array(
  25. 'local' => array('your-machine-name'),
  26. ));
  27. /*
  28. |--------------------------------------------------------------------------
  29. | Bind Paths
  30. |--------------------------------------------------------------------------
  31. |
  32. | Here we are binding the paths configured in paths.php to the app. You
  33. | should not be changing these here. If you need to change these you
  34. | may do so within the paths.php file and they will be bound here.
  35. |
  36. */
  37. $app->bindInstallPaths(require __DIR__.'/paths.php');
  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. $framework = $app['path.base'].'/vendor/laravel/framework/src';
  49. require $framework.'/Illuminate/Foundation/start.php';
  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;