diff --git a/artisan b/artisan index aaebd2db..0bc00260 100644 --- a/artisan +++ b/artisan @@ -1,42 +1,9 @@ - * @link http://laravel.com - */ // -------------------------------------------------------------- -// Define the directory separator for the environment. +// Set the core Laravel path constants. // -------------------------------------------------------------- -define('DS', DIRECTORY_SEPARATOR); - -// -------------------------------------------------------------- -// The path to the application directory. -// -------------------------------------------------------------- -define('APP_PATH', realpath('application').'/'); - -// -------------------------------------------------------------- -// The path to the bundles directory. -// -------------------------------------------------------------- -define('BUNDLE_PATH', realpath('bundles').'/'); - -// -------------------------------------------------------------- -// The path to the storage directory. -// -------------------------------------------------------------- -define('STORAGE_PATH', realpath('storage').'/'); - -// -------------------------------------------------------------- -// The path to the Laravel directory. -// -------------------------------------------------------------- -define('SYS_PATH', realpath('laravel').'/'); - -// -------------------------------------------------------------- -// The path to the public directory. -// -------------------------------------------------------------- -define('PUBLIC_PATH', realpath('public').'/'); +require 'paths.php'; // -------------------------------------------------------------- // Bootstrap the Laravel core. diff --git a/paths.php b/paths.php new file mode 100644 index 00000000..5804b034 --- /dev/null +++ b/paths.php @@ -0,0 +1,56 @@ + $path) +{ + if ( ! defined($name)) + { + $path = ($web) ? '../'.$path : $path; + + define($name, realpath($path).DS); + } +} \ No newline at end of file diff --git a/public/index.php b/public/index.php index cc14e3e6..06fc9953 100644 --- a/public/index.php +++ b/public/index.php @@ -14,34 +14,19 @@ define('LARAVEL_START', microtime(true)); // -------------------------------------------------------------- -// Define the directory separator for the environment. +// Indicate that the request is from the web. // -------------------------------------------------------------- -define('DS', DIRECTORY_SEPARATOR); +$web = true; // -------------------------------------------------------------- -// The path to the application directory. +// Set the core Laravel path constants. // -------------------------------------------------------------- -define('APP_PATH', realpath('../application').DS); +require '../paths.php'; // -------------------------------------------------------------- -// The path to the bundles directory. +// Unset the temporary web variable. // -------------------------------------------------------------- -define('BUNDLE_PATH', realpath('../bundles').DS); - -// -------------------------------------------------------------- -// The path to the storage directory. -// -------------------------------------------------------------- -define('STORAGE_PATH', realpath('../storage').DS); - -// -------------------------------------------------------------- -// The path to the Laravel directory. -// -------------------------------------------------------------- -define('SYS_PATH', realpath('../laravel').DS); - -// -------------------------------------------------------------- -// The path to the public directory. -// -------------------------------------------------------------- -define('PUBLIC_PATH', realpath(__DIR__).DS); +unset($web); // -------------------------------------------------------------- // Launch Laravel.