paths.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. if ( ! defined('DS'))
  18. {
  19. define('DS', DIRECTORY_SEPARATOR);
  20. }
  21. // --------------------------------------------------------------
  22. // Define the path to the base directory.
  23. // --------------------------------------------------------------
  24. $GLOBALS['BASE_PATH'] = __DIR__.DS;
  25. // --------------------------------------------------------------
  26. // The path to the application directory.
  27. // --------------------------------------------------------------
  28. $paths['APP_PATH'] = 'application';
  29. // --------------------------------------------------------------
  30. // The path to the Laravel directory.
  31. // --------------------------------------------------------------
  32. $paths['SYS_PATH'] = 'laravel';
  33. // --------------------------------------------------------------
  34. // The path to the bundles directory.
  35. // --------------------------------------------------------------
  36. $paths['BUNDLE_PATH'] = 'bundles';
  37. // --------------------------------------------------------------
  38. // The path to the storage directory.
  39. // --------------------------------------------------------------
  40. $paths['STORAGE_PATH'] = 'storage';
  41. // --------------------------------------------------------------
  42. // The path to the public directory.
  43. // --------------------------------------------------------------
  44. if ($web)
  45. {
  46. $GLOBALS['PUBLIC_PATH'] = realpath('').DS;
  47. }
  48. else
  49. {
  50. $paths['PUBLIC'] = 'public';
  51. }
  52. // --------------------------------------------------------------
  53. // Define each constant if it hasn't been defined.
  54. // --------------------------------------------------------------
  55. foreach ($paths as $name => $path)
  56. {
  57. if ($web) $path = "../{$path}";
  58. $GLOBALS[$name] = realpath($path).DS;
  59. }