Files
spa-api/paths.php

85 lines
2.7 KiB
PHP
Raw Normal View History

2012-01-17 15:28:19 -06:00
<?php
2012-01-17 16:10:16 -06:00
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
2012-01-28 14:55:08 -06:00
* @version 3.0.0
2012-01-17 16:10:16 -06:00
* @author Taylor Otwell <taylorotwell@gmail.com>
* @link http://laravel.com
*/
2012-01-17 15:28:19 -06:00
// --------------------------------------------------------------
// Initialize the web variable if it doesn't exist.
// --------------------------------------------------------------
if ( ! isset($web)) $web = false;
// --------------------------------------------------------------
// Define the directory separator for the environment.
// --------------------------------------------------------------
if ( ! defined('DS'))
{
define('DS', DIRECTORY_SEPARATOR);
}
2012-01-17 15:28:19 -06:00
2012-01-18 09:58:56 -06:00
// --------------------------------------------------------------
// Define the path to the base directory.
// --------------------------------------------------------------
2012-01-28 14:55:08 -06:00
$GLOBALS['laravel_paths']['base'] = __DIR__.DS;
2012-01-18 09:58:56 -06:00
2012-01-17 15:28:19 -06:00
// --------------------------------------------------------------
// The path to the application directory.
// --------------------------------------------------------------
2012-01-28 14:55:08 -06:00
$paths['app'] = 'application';
2012-01-17 15:28:19 -06:00
// --------------------------------------------------------------
// The path to the Laravel directory.
// --------------------------------------------------------------
2012-01-28 14:55:08 -06:00
$paths['sys'] = 'laravel';
2012-01-17 15:28:19 -06:00
// --------------------------------------------------------------
// The path to the bundles directory.
// --------------------------------------------------------------
2012-01-28 14:55:08 -06:00
$paths['bundle'] = 'bundles';
2012-01-17 15:28:19 -06:00
// --------------------------------------------------------------
// The path to the storage directory.
// --------------------------------------------------------------
2012-01-28 14:55:08 -06:00
$paths['storage'] = 'storage';
2012-01-17 15:28:19 -06:00
// --------------------------------------------------------------
// The path to the public directory.
// --------------------------------------------------------------
if ($web)
{
2012-01-28 14:55:08 -06:00
$GLOBALS['laravel_paths']['public'] = realpath('').DS;
2012-01-17 15:28:19 -06:00
}
else
{
2012-01-28 14:55:08 -06:00
$paths['public'] = 'public';
2012-01-17 15:28:19 -06:00
}
// --------------------------------------------------------------
// Define each constant if it hasn't been defined.
// --------------------------------------------------------------
foreach ($paths as $name => $path)
{
2012-01-27 16:17:43 -06:00
if ($web) $path = "../{$path}";
2012-01-17 15:28:19 -06:00
2012-01-28 14:55:08 -06:00
$GLOBALS['laravel_paths'][$name] = realpath($path).DS;
}
// --------------------------------------------------------------
// Define a global path helper function.
// --------------------------------------------------------------
function path($path)
{
return $GLOBALS['laravel_paths'][$path];
}
// --------------------------------------------------------------
// Define a global path setter function.
// --------------------------------------------------------------
function set_path($path, $value)
{
$GLOBALS['laravel_paths'][$path] = $value;
2012-01-17 15:28:19 -06:00
}