Skip to content

Commit 7ed7e92

Browse files
bug #48624 [ErrorHandler][HttpKernel] Fix reading the SYMFONY_IDE env var (nicolas-grekas)
This PR was merged into the 6.1 branch. Discussion ---------- [ErrorHandler][HttpKernel] Fix reading the SYMFONY_IDE env var | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- ac52802 [HttpKernel][ErrorHandler] Fix reading the SYMFONY_IDE env var
2 parents c195e1d + ac52802 commit 7ed7e92

File tree

6 files changed

+7
-2
lines changed

6 files changed

+7
-2
lines changed

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<ini name="intl.default_locale" value="en" />
1414
<ini name="intl.error_level" value="0" />
1515
<ini name="memory_limit" value="-1" />
16+
<env name="SYMFONY_IDE" value="" force="true" />
1617
<env name="DUMP_LIGHT_ARRAY" value="" />
1718
<env name="DUMP_STRING_LENGTH" value="" />
1819
<env name="LDAP_HOST" value="localhost" />

src/Symfony/Bundle/FrameworkBundle/phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
>
1111
<php>
1212
<ini name="error_reporting" value="-1" />
13+
<env name="SYMFONY_IDE" value="" force="true" />
1314
<env name="REDIS_HOST" value="localhost" />
1415
<env name="MEMCACHED_HOST" value="localhost" />
1516
</php>

src/Symfony/Component/ErrorHandler/ErrorRenderer/HtmlErrorRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(bool|callable $debug = false, string $charset = null
5050
{
5151
$this->debug = \is_bool($debug) ? $debug : $debug(...);
5252
$this->charset = $charset ?: (\ini_get('default_charset') ?: 'UTF-8');
53-
$fileLinkFormat ??= $_SERVER['SYMFONY_IDE'] ?? null;
53+
$fileLinkFormat ??= $_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? null;
5454
$this->fileLinkFormat = \is_string($fileLinkFormat)
5555
? (ErrorRendererInterface::IDE_LINK_FORMATS[$fileLinkFormat] ?? $fileLinkFormat ?: false)
5656
: ($fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: false);

src/Symfony/Component/ErrorHandler/phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
>
1111
<php>
1212
<ini name="error_reporting" value="-1" />
13+
<env name="SYMFONY_IDE" value="" force="true" />
1314
</php>
1415

1516
<testsuites>

src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class FileLinkFormatter
3535
*/
3636
public function __construct(string|array $fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, string|\Closure $urlFormat = null)
3737
{
38-
$fileLinkFormat ??= $_SERVER['SYMFONY_IDE'] ?? '';
38+
$fileLinkFormat ??= $_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? '';
39+
3940
if (!\is_array($fileLinkFormat) && $fileLinkFormat = (ErrorRendererInterface::IDE_LINK_FORMATS[$fileLinkFormat] ?? $fileLinkFormat) ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: false) {
4041
$i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: \strlen($f);
4142
$fileLinkFormat = [substr($f, 0, $i)] + preg_split('/&([^>]++)>/', substr($f, $i), -1, \PREG_SPLIT_DELIM_CAPTURE);

src/Symfony/Component/HttpKernel/phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
>
1111
<php>
1212
<ini name="error_reporting" value="-1" />
13+
<env name="SYMFONY_IDE" value="" force="true" />
1314
</php>
1415

1516
<testsuites>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy