function XdebugHandler::doRestart
Executes the restarted command then deletes the tmp ini
@phpstan-return never
Parameters
non-empty-list<string> $command:
1 call to XdebugHandler::doRestart()
- XdebugHandler::restart in vendor/
composer/ xdebug-handler/ src/ XdebugHandler.php - Allows an extending class to access the tmpIni
File
-
vendor/
composer/ xdebug-handler/ src/ XdebugHandler.php, line 283
Class
- XdebugHandler
- @author John Stevenson <john-stevenson@blueyonder.co.uk>
Namespace
Composer\XdebugHandlerCode
private function doRestart(array $command) : void {
if (PHP_VERSION_ID >= 70400) {
$cmd = $command;
$displayCmd = sprintf('[%s]', implode(', ', $cmd));
}
else {
$cmd = Process::escapeShellCommand($command);
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
// Outer quotes required on cmd string below PHP 8
$cmd = '"' . $cmd . '"';
}
$displayCmd = $cmd;
}
$this->tryEnableSignals();
$this->notify(Status::RESTARTING, $displayCmd);
$process = proc_open($cmd, [], $pipes);
if (is_resource($process)) {
$exitCode = proc_close($process);
}
if (!isset($exitCode)) {
// Unlikely that php or the default shell cannot be invoked
$this->notify(Status::ERROR, 'Unable to restart process');
$exitCode = -1;
}
else {
$this->notify(Status::INFO, 'Restarted process exited ' . $exitCode);
}
if ($this->debug === '2') {
$this->notify(Status::INFO, 'Temp ini saved: ' . $this->tmpIni);
}
else {
@unlink((string) $this->tmpIni);
}
exit($exitCode);
}