only define environment constant if it hasnt already been defined.

This commit is contained in:
Taylor Otwell 2011-10-20 21:47:20 -05:00
parent af36cb3d5a
commit 23c79a0317
1 changed files with 2 additions and 4 deletions

View File

@ -56,8 +56,6 @@ function constants($constants)
constants($constants); constants($constants);
unset($constants);
/** /**
* Set the Laravel environment configuration path constant. * Set the Laravel environment configuration path constant.
* The environment is controlled by setting an environment * The environment is controlled by setting an environment
@ -65,6 +63,6 @@ function constants($constants)
*/ */
$environment = (isset($_SERVER['LARAVEL_ENV'])) ? $_SERVER['LARAVEL_ENV'] : ''; $environment = (isset($_SERVER['LARAVEL_ENV'])) ? $_SERVER['LARAVEL_ENV'] : '';
define('ENV_CONFIG_PATH', $environment); constants(array('ENV_CONFIG_PATH' => $environment));
unset($environment); unset($constants, $environment);