-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Describe the bug
Symfony Var Dumper now relies on this variable to resolve appropriate dumper when format is not specified explicitly.
To Reproduce
Dump a variable in Drush command on Drupal 8.3 site.
Expected behavior
A dump in CLI format
Actual behavior
A dump in HTML format
Workaround
Put this line to settings.php
$_SERVER['VAR_DUMPER_FORMAT'] = \PHP_SAPI === 'cli' ? 'cli' : 'html';System Configuration
| Q | A |
|---|---|
| Drush version? | 13.7 |
| Drupal version? | 11.3 |
| PHP version | 8.4 |
| OS? | Linux |
Additional information
The $_SERVER['HTTP_ACCEPT'] is set in \Drush\Boot\DrupalBoot8::bootstrapDrupalSiteValidate.
I suppose we can simply remove $request->overrideGlobals(); call as there is no point to set 'HTTP_' variables in CLI SAPI. The other way is setting HTTP_ACCEPT manually like follows.
$server = [
'SCRIPT_FILENAME' => getcwd() . '/index.php',
'SCRIPT_NAME' => isset($parsed_url['path']) ? $parsed_url['path'] . 'index.php' : '/index.php',
'HTTP_ACCEPT' => '',
] + $_SERVER;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels