refactoring various things.

This commit is contained in:
Taylor Otwell
2011-09-16 19:59:20 -05:00
parent 1b75302d8c
commit 77dc8d2014
10 changed files with 139 additions and 120 deletions

View File

@@ -49,7 +49,9 @@ if (file_exists($path = CONFIG_PATH.'container'.EXT))
$dependencies = array_merge($dependencies, require $path);
}
if (isset($_SERVER['LARAVEL_ENV']) and file_exists($path = CONFIG_PATH.$_SERVER['LARAVEL_ENV'].'/container'.EXT))
$env = (isset($_SERVER['LARAVEL_ENV'])) ? $_SERVER['LARAVEL_ENV'] : null;
if ( ! is_null($env) and file_exists($path = CONFIG_PATH.$env.'/container'.EXT))
{
$dependencies = array_merge($dependencies, require $path);
}
@@ -61,4 +63,9 @@ IoC::$container = $container;
// --------------------------------------------------------------
// Register the auto-loader on the auto-loader stack.
// --------------------------------------------------------------
spl_autoload_register(array($container->resolve('laravel.loader'), 'load'));
spl_autoload_register(array($container->resolve('laravel.loader'), 'load'));
// --------------------------------------------------------------
// Set the application environment configuration option.
// --------------------------------------------------------------
$container->resolve('laravel.config')->set('application.env', $env);