paths.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. // --------------------------------------------------------------
  3. // Initialize the web variable if it doesn't exist.
  4. // --------------------------------------------------------------
  5. if ( ! isset($web)) $web = false;
  6. // --------------------------------------------------------------
  7. // Define the directory separator for the environment.
  8. // --------------------------------------------------------------
  9. define('DS', DIRECTORY_SEPARATOR);
  10. // --------------------------------------------------------------
  11. // The path to the application directory.
  12. // --------------------------------------------------------------
  13. $paths['APP_PATH'] = 'application';
  14. // --------------------------------------------------------------
  15. // The path to the bundles directory.
  16. // --------------------------------------------------------------
  17. $paths['BUNDLE_PATH'] = 'bundles';
  18. // --------------------------------------------------------------
  19. // The path to the storage directory.
  20. // --------------------------------------------------------------
  21. $paths['STORAGE_PATH'] = 'storage';
  22. // --------------------------------------------------------------
  23. // The path to the Laravel directory.
  24. // --------------------------------------------------------------
  25. $paths['SYS_PATH'] = 'laravel';
  26. // --------------------------------------------------------------
  27. // The path to the public directory.
  28. // --------------------------------------------------------------
  29. if ($web)
  30. {
  31. define('PUBLIC_PATH', realpath('').DS);
  32. }
  33. else
  34. {
  35. $paths['PUBLIC_PATH'] = 'public';
  36. }
  37. // --------------------------------------------------------------
  38. // Define each constant if it hasn't been defined.
  39. // --------------------------------------------------------------
  40. foreach ($paths as $name => $path)
  41. {
  42. if ( ! defined($name))
  43. {
  44. $path = ($web) ? '../'.$path : $path;
  45. define($name, realpath($path).DS);
  46. }
  47. }