8000 Merge pull request #736 from joecwallace/cli-env-management · laravel/laravel@930a3e8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 930a3e8

Browse files
committed
Merge pull request #736 from joecwallace/cli-env-management
Check against host name for CLI commands
2 parents b1707f2 + 1aabbc3 commit 930a3e8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

laravel/core.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,19 @@
148148
|--------------------------------------------------------------------------
149149
|
150150
| Next we're ready to determine the application environment. This may be
151-
| set either via the command line options, or, if the request is from
152-
| the web, via the mapping of URIs to environments that lives in
153-
| the "paths.php" file for the application and is parsed.
151+
| set either via the command line options or via the mapping of URIs to
152+
| environments that lives in the "paths.php" file for the application and
153+
| is parsed. When determining the CLI environment, the "--env" CLI option
154+
| overrides the mapping in "paths.php".
154155
|
155156
*/
156-
157157
if (Request::cli())
158158
{
159159
$environment = get_cli_option('env');
160+
161+
if (! isset($environment)) {
162+
$environment = Request::detect_env($environments, gethostname());
163+
}
160164
}
161165
else
162166
{

0 commit comments

Comments
 (0)
0