paths.php 3.24 KB
Newer Older
1
<?php
Taylor Otwell committed
2 3 4 5
/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
6
 * @version  3.1.8
Taylor Otwell committed
7 8 9
 * @author   Taylor Otwell <taylorotwell@gmail.com>
 * @link     http://laravel.com
 */
10

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/*
|----------------------------------------------------------------
| Application Environemtns
|----------------------------------------------------------------
|
| Laravel takes a dead simple approach to environments, and we
| think you'll love it. Just specify which URLs belongs to a
| given environment, and when you access your application
| from a URL matching that pattern, we'll be sure to
| merge in that environment's configuration files.
|
*/

$environments = array(

26
	'local' => array('http://localhost*', '*.dev'),
27 28 29

);

30 31 32
// --------------------------------------------------------------
// The path to the application directory.
// --------------------------------------------------------------
Taylor Otwell committed
33
$paths['app'] = 'application';
34 35

// --------------------------------------------------------------
36 37
// The path to the Laravel directory.
// --------------------------------------------------------------
Taylor Otwell committed
38
$paths['sys'] = 'laravel';
39 40

// --------------------------------------------------------------
41 42
// The path to the bundles directory.
// --------------------------------------------------------------
Taylor Otwell committed
43
$paths['bundle'] = 'bundles';
44 45 46 47

// --------------------------------------------------------------
// The path to the storage directory.
// --------------------------------------------------------------
Taylor Otwell committed
48
$paths['storage'] = 'storage';
49 50 51 52

// --------------------------------------------------------------
// The path to the public directory.
// --------------------------------------------------------------
53
$paths['public'] = 'public';
54

55 56 57 58
// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
// END OF USER CONFIGURATION. HERE BE DRAGONS!
// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

59
// --------------------------------------------------------------
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
// Change to the current working directory.
// --------------------------------------------------------------
chdir(__DIR__);

// --------------------------------------------------------------
// Define the directory separator for the environment.
// --------------------------------------------------------------
if ( ! defined('DS'))
{
	define('DS', DIRECTORY_SEPARATOR);
}

// --------------------------------------------------------------
// Define the path to the base directory.
// --------------------------------------------------------------
$GLOBALS['laravel_paths']['base'] = __DIR__.DS;

// --------------------------------------------------------------
78 79 80 81
// Define each constant if it hasn't been defined.
// --------------------------------------------------------------
foreach ($paths as $name => $path)
{
82 83 84 85
	if ( ! isset($GLOBALS['laravel_paths'][$name]))
	{
		$GLOBALS['laravel_paths'][$name] = realpath($path).DS;
	}
Taylor Otwell committed
86 87
}

Phill Sparks committed
88 89 90 91 92 93 94 95 96 97
/**
 * A global path helper function.
 * 
 * <code>
 *     $storage = path('storage');
 * </code>
 * 
 * @param  string  $path
 * @return string
 */
Taylor Otwell committed
98 99 100 101 102
function path($path)
{
	return $GLOBALS['laravel_paths'][$path];
}

Phill Sparks committed
103 104 105 106 107 108 109
/**
 * A global path setter function.
 * 
 * @param  string  $path
 * @param  string  $value
 * @return void
 */
Taylor Otwell committed
110 111 112
function set_path($path, $value)
{
	$GLOBALS['laravel_paths'][$path] = $value;
113
}