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

Breadcrumb

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

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

Code

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

API Navigation

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