fixing some issues related to environment.
This commit is contained in:
@@ -226,9 +226,9 @@ class Config {
|
|||||||
// Configuration files can be made specific for a given environment. If an
|
// Configuration files can be made specific for a given environment. If an
|
||||||
// environment has been set, we will merge the environment configuration
|
// environment has been set, we will merge the environment configuration
|
||||||
// in last, so that it overrides all other options.
|
// in last, so that it overrides all other options.
|
||||||
if (isset($_SERVER['LARAVEL_ENV']))
|
if ( ! is_null(Request::env()))
|
||||||
{
|
{
|
||||||
$paths[] = $paths[count($paths) - 1].$_SERVER['LARAVEL_ENV'].'/';
|
$paths[] = $paths[count($paths) - 1].Request::env().'/';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $paths;
|
return $paths;
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ else
|
|||||||
|
|
||||||
if ( ! is_null($environment))
|
if ( ! is_null($environment))
|
||||||
{
|
{
|
||||||
Request::foundation()->server->set('LARAVEL_ENV', $environment);
|
Request::set_env($environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -197,6 +197,17 @@ class Request {
|
|||||||
return static::foundation()->server->get('LARAVEL_ENV');
|
return static::foundation()->server->get('LARAVEL_ENV');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the Laravel environment for the current request.
|
||||||
|
*
|
||||||
|
* @param string $env
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function set_env($env)
|
||||||
|
{
|
||||||
|
static::foundation()->server->set('LARAVEL_ENV', $env);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the current request environment.
|
* Determine the current request environment.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user