paths.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * Laravel - A PHP Framework For Web Artisans
  4. *
  5. * @package Laravel
  6. * @version 3.2.7
  7. * @author Taylor Otwell <taylorotwell@gmail.com>
  8. * @link http://laravel.com
  9. */
  10. /*
  11. |----------------------------------------------------------------
  12. | Application Environments
  13. |----------------------------------------------------------------
  14. |
  15. | Laravel takes a dead simple approach to environments, and we
  16. | think you'll love it. Just specify which URLs belong to a
  17. | given environment, and when you access your application
  18. | from a URL matching that pattern, we'll be sure to
  19. | merge in that environment's configuration files.
  20. |
  21. */
  22. $environments = array(
  23. 'local' => array('http://localhost*', '*.dev'),
  24. );
  25. // --------------------------------------------------------------
  26. // The path to the application directory.
  27. // --------------------------------------------------------------
  28. $paths['app'] = 'application';
  29. // --------------------------------------------------------------
  30. // The path to the Laravel directory.
  31. // --------------------------------------------------------------
  32. $paths['sys'] = 'laravel';
  33. // --------------------------------------------------------------
  34. // The path to the bundles directory.
  35. // --------------------------------------------------------------
  36. $paths['bundle'] = 'bundles';
  37. // --------------------------------------------------------------
  38. // The path to the storage directory.
  39. // --------------------------------------------------------------
  40. $paths['storage'] = 'storage';
  41. // --------------------------------------------------------------
  42. // The path to the public directory.
  43. // --------------------------------------------------------------
  44. $paths['public'] = 'public';
  45. // *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
  46. // END OF USER CONFIGURATION. HERE BE DRAGONS!
  47. // *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
  48. // --------------------------------------------------------------
  49. // Change to the current working directory.
  50. // --------------------------------------------------------------
  51. chdir(__DIR__);
  52. // --------------------------------------------------------------
  53. // Define the directory separator for the environment.
  54. // --------------------------------------------------------------
  55. if ( ! defined('DS'))
  56. {
  57. define('DS', DIRECTORY_SEPARATOR);
  58. }
  59. // --------------------------------------------------------------
  60. // Define the path to the base directory.
  61. // --------------------------------------------------------------
  62. $GLOBALS['laravel_paths']['base'] = __DIR__.DS;
  63. // --------------------------------------------------------------
  64. // Define each constant if it hasn't been defined.
  65. // --------------------------------------------------------------
  66. foreach ($paths as $name => $path)
  67. {
  68. if ( ! isset($GLOBALS['laravel_paths'][$name]))
  69. {
  70. $GLOBALS['laravel_paths'][$name] = realpath($path).DS;
  71. }
  72. }
  73. /**
  74. * A global path helper function.
  75. *
  76. * <code>
  77. * $storage = path('storage');
  78. * </code>
  79. *
  80. * @param string $path
  81. * @return string
  82. */
  83. function path($path)
  84. {
  85. return $GLOBALS['laravel_paths'][$path];
  86. }
  87. /**
  88. * A global path setter function.
  89. *
  90. * @param string $path
  91. * @param string $value
  92. * @return void
  93. */
  94. function set_path($path, $value)
  95. {
  96. $GLOBALS['laravel_paths'][$path] = $value;
  97. }