Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite9971b5

Browse files
committed
Read environment variable from superglobals
The Dotenv component has recently been switched to using superglobalsinstead of putenv(). Let us support both and give priority tosuperglobals.Closes#31857
1 parent3b0e9df commite9971b5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

‎src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,28 @@ public function shutdown()
209209
});
210210
}
211211

212+
/**
213+
* @return mixed string|false
214+
*/
215+
privatefunctiongetModeFromEnvironment()
216+
{
217+
if (isset($_SERVER['SYMFONY_DEPRECATIONS_HELPER'])) {
218+
return$_SERVER['SYMFONY_DEPRECATIONS_HELPER'];
219+
}
220+
221+
if (isset($_ENV['SYMFONY_DEPRECATIONS_HELPER'])) {
222+
return$_ENV['SYMFONY_DEPRECATIONS_HELPER'];
223+
}
224+
225+
returngetenv('SYMFONY_DEPRECATIONS_HELPER');
226+
}
227+
212228
privatefunctiongetConfiguration()
213229
{
214230
if (null !==$this->configuration) {
215231
return$this->configuration;
216232
}
217-
$mode =getenv('SYMFONY_DEPRECATIONS_HELPER');
233+
$mode =$this->getModeFromEnvironment();
218234
if ('strict' ===$mode) {
219235
return$this->configuration = Configuration::inStrictMode();
220236
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp