paths.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Laravel - A PHP Framework For Web Artisans
  4. *
  5. * @package Laravel
  6. * @version 2.2.0 (Beta 1)
  7. * @author Taylor Otwell <taylorotwell@gmail.com>
  8. * @link http://laravel.com
  9. */
  10. // --------------------------------------------------------------
  11. // Initialize the web variable if it doesn't exist.
  12. // --------------------------------------------------------------
  13. if ( ! isset($web)) $web = false;
  14. // --------------------------------------------------------------
  15. // Define the directory separator for the environment.
  16. // --------------------------------------------------------------
  17. define('DS', DIRECTORY_SEPARATOR);
  18. // --------------------------------------------------------------
  19. // The path to the application directory.
  20. // --------------------------------------------------------------
  21. $paths['APP_PATH'] = 'application';
  22. // --------------------------------------------------------------
  23. // The path to the bundles directory.
  24. // --------------------------------------------------------------
  25. $paths['BUNDLE_PATH'] = 'bundles';
  26. // --------------------------------------------------------------
  27. // The path to the storage directory.
  28. // --------------------------------------------------------------
  29. $paths['STORAGE_PATH'] = 'storage';
  30. // --------------------------------------------------------------
  31. // The path to the Laravel directory.
  32. // --------------------------------------------------------------
  33. $paths['SYS_PATH'] = 'laravel';
  34. // --------------------------------------------------------------
  35. // The path to the public directory.
  36. // --------------------------------------------------------------
  37. if ($web)
  38. {
  39. define('PUBLIC_PATH', realpath('').DS);
  40. }
  41. else
  42. {
  43. $paths['PUBLIC_PATH'] = 'public';
  44. }
  45. // --------------------------------------------------------------
  46. // Define each constant if it hasn't been defined.
  47. // --------------------------------------------------------------
  48. foreach ($paths as $name => $path)
  49. {
  50. if ( ! defined($name))
  51. {
  52. $path = ($web) ? '../'.$path : $path;
  53. define($name, realpath($path).DS);
  54. }
  55. }