From 1aabbc38bb3a04f045e319e48e6a2680723ca775 Mon Sep 17 00:00:00 2001 From: Joe Wallace Date: Tue, 22 May 2012 11:04:17 -0500 Subject: [PATCH] Check against host name for CLI commands --- laravel/core.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/laravel/core.php b/laravel/core.php index 0dcaaca5..eb24b950 100644 --- a/laravel/core.php +++ b/laravel/core.php @@ -148,15 +148,19 @@ |-------------------------------------------------------------------------- | | Next we're ready to determine the application environment. This may be -| set either via the command line options, or, if the request is from -| the web, via the mapping of URIs to environments that lives in -| the "paths.php" file for the application and is parsed. +| set either via the command line options or via the mapping of URIs to +| environments that lives in the "paths.php" file for the application and +| is parsed. When determining the CLI environment, the "--env" CLI option +| overrides the mapping in "paths.php". | */ - if (Request::cli()) { $environment = get_cli_option('env'); + + if (! isset($environment)) { + $environment = Request::detect_env($environments, gethostname()); + } } else {