function XdebugHandler::tryEnableSignals
Enables async signals and control interrupts in the restarted process
Available on Unix PHP 7.1+ with the pcntl extension and Windows PHP 7.4+.
2 calls to XdebugHandler::tryEnableSignals()
- XdebugHandler::check in vendor/
composer/ xdebug-handler/ src/ XdebugHandler.php - Checks if Xdebug is loaded and the process needs to be restarted
- XdebugHandler::doRestart in vendor/
composer/ xdebug-handler/ src/ XdebugHandler.php - Executes the restarted command then deletes the tmp ini
File
-
vendor/
composer/ xdebug-handler/ src/ XdebugHandler.php, line 631
Class
- XdebugHandler
- @author John Stevenson <john-stevenson@blueyonder.co.uk>
Namespace
Composer\XdebugHandlerCode
private function tryEnableSignals() : void {
if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {
pcntl_async_signals(true);
$message = 'Async signals enabled';
if (!self::$inRestart) {
// Restarting, so ignore SIGINT in parent
pcntl_signal(SIGINT, SIG_IGN);
}
elseif (is_int(pcntl_signal_get_handler(SIGINT))) {
// Restarted, no handler set so force default action
pcntl_signal(SIGINT, SIG_DFL);
}
}
if (!self::$inRestart && function_exists('sapi_windows_set_ctrl_handler')) {
// Restarting, so set a handler to ignore CTRL events in the parent.
// This ensures that CTRL+C events will be available in the child
// process without having to enable them there, which is unreliable.
sapi_windows_set_ctrl_handler(function ($evt) {
});
}
}