1
0
Fork 0

Workaround PHP bug with env vars not being read correctly on Windows, fixes #10434

refs https://github.com/php/php-src/issues/7896
pull/10432/head
Jordi Boggiano 2022-01-07 09:17:25 +01:00
parent 9360e2c18a
commit 65c8daa969
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,12 @@ if (function_exists('ini_set')) {
unset($memoryLimit); unset($memoryLimit);
} }
// Workaround PHP bug on Windows where env vars containing Unicode chars are mangled in $_SERVER
// see https://github.com/php/php-src/issues/7896
if (Platform::isWindows()) {
$_SERVER = array_merge($_SERVER, array_intersect_ukey($_SERVER, getenv(), 'strcasecmp'));
}
Platform::putEnv('COMPOSER_BINARY', realpath($_SERVER['argv'][0])); Platform::putEnv('COMPOSER_BINARY', realpath($_SERVER['argv'][0]));
ErrorHandler::register(); ErrorHandler::register();