Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. XdebugHandler.php

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\XdebugHandler

Code

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) {
        });
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal