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

Breadcrumb

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

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

Code

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

API Navigation

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