paths.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * Laravel - A PHP Framework For Web Artisans
  4. *
  5. * @package Laravel
  6. * @version 3.1.7
  7. * @author Taylor Otwell <taylorotwell@gmail.com>
  8. * @link http://laravel.com
  9. */
  10. // --------------------------------------------------------------
  11. // The path to the application directory.
  12. // --------------------------------------------------------------
  13. $paths['app'] = 'application';
  14. // --------------------------------------------------------------
  15. // The path to the Laravel directory.
  16. // --------------------------------------------------------------
  17. $paths['sys'] = 'laravel';
  18. // --------------------------------------------------------------
  19. // The path to the bundles directory.
  20. // --------------------------------------------------------------
  21. $paths['bundle'] = 'bundles';
  22. // --------------------------------------------------------------
  23. // The path to the storage directory.
  24. // --------------------------------------------------------------
  25. $paths['storage'] = 'storage';
  26. // --------------------------------------------------------------
  27. // The path to the public directory.
  28. // --------------------------------------------------------------
  29. $paths['public'] = 'public';
  30. // *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
  31. // END OF USER CONFIGURATION. HERE BE DRAGONS!
  32. // *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
  33. // --------------------------------------------------------------
  34. // Change to the current working directory.
  35. // --------------------------------------------------------------
  36. chdir(__DIR__);
  37. // --------------------------------------------------------------
  38. // Define the directory separator for the environment.
  39. // --------------------------------------------------------------
  40. if ( ! defined('DS'))
  41. {
  42. define('DS', DIRECTORY_SEPARATOR);
  43. }
  44. // --------------------------------------------------------------
  45. // Define the path to the base directory.
  46. // --------------------------------------------------------------
  47. $GLOBALS['laravel_paths']['base'] = __DIR__.DS;
  48. // --------------------------------------------------------------
  49. // Define each constant if it hasn't been defined.
  50. // --------------------------------------------------------------
  51. foreach ($paths as $name => $path)
  52. {
  53. if ( ! isset($GLOBALS['laravel_paths'][$name]))
  54. {
  55. $GLOBALS['laravel_paths'][$name] = realpath($path).DS;
  56. }
  57. }
  58. /**
  59. * A global path helper function.
  60. *
  61. * <code>
  62. * $storage = path('storage');
  63. * </code>
  64. *
  65. * @param string $path
  66. * @return string
  67. */
  68. function path($path)
  69. {
  70. return $GLOBALS['laravel_paths'][$path];
  71. }
  72. /**
  73. * A global path setter function.
  74. *
  75. * @param string $path
  76. * @param string $value
  77. * @return void
  78. */
  79. function set_path($path, $value)
  80. {
  81. $GLOBALS['laravel_paths'][$path] = $value;
  82. }