function XdebugHandler::setEnvironment
Returns true if the restart environment variables were set
No need to update $_SERVER since this is set in the restarted process.
Parameters
non-empty-list<string> $iniFiles All ini files used in the current process:
1 call to XdebugHandler::setEnvironment()
- XdebugHandler::prepareRestart in vendor/
composer/ xdebug-handler/ src/ XdebugHandler.php - Returns the command line array if everything was written for the restart
File
-
vendor/
composer/ xdebug-handler/ src/ XdebugHandler.php, line 456
Class
- XdebugHandler
- @author John Stevenson <john-stevenson@blueyonder.co.uk>
Namespace
Composer\XdebugHandlerCode
private function setEnvironment(bool $scannedInis, array $iniFiles, string $tmpIni) : bool {
$scanDir = getenv('PHP_INI_SCAN_DIR');
$phprc = getenv('PHPRC');
// Make original inis available to restarted process
if (!putenv($this->envOriginalInis . '=' . implode(PATH_SEPARATOR, $iniFiles))) {
return false;
}
if ($this->persistent) {
// Use the environment to persist the settings
if (!putenv('PHP_INI_SCAN_DIR=') || !putenv('PHPRC=' . $tmpIni)) {
return false;
}
}
// Flag restarted process and save values for it to use
$envArgs = [
self::RESTART_ID,
self::$xdebugVersion,
(int) $scannedInis,
false === $scanDir ? '*' : $scanDir,
false === $phprc ? '*' : $phprc,
];
return putenv($this->envAllowXdebug . '=' . implode('|', $envArgs));
}