Skip to content

Commit cf81c2a

Browse files
Jordan Hofftaylorotwell
authored andcommitted
Better cli detection for phpdbg (#18781)
1 parent 8877cf6 commit cf81c2a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function bootstrap(Application $app)
3838
*/
3939
protected function checkForSpecificEnvironmentFile($app)
4040
{
41-
if (php_sapi_name() == 'cli' && ($input = new ArgvInput)->hasParameterOption('--env')) {
41+
if ($app->runningInConsole() && ($input = new ArgvInput)->hasParameterOption('--env')) {
4242
$this->setEnvironmentFilePath(
4343
$app, $app->environmentFile().'.'.$input->getParameterOption('--env')
4444
);

src/Illuminate/Support/Debug/Dumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Dumper
1616
public function dump($value)
1717
{
1818
if (class_exists(CliDumper::class)) {
19-
$dumper = 'cli' === PHP_SAPI ? new CliDumper : new HtmlDumper;
19+
$dumper = in_array(PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper : new HtmlDumper;
2020

2121
$dumper->dump((new VarCloner)->cloneVar($value));
2222
} else {

0 commit comments

Comments
 (0)