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

Breadcrumb

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

function XdebugHandler::checkMainScript

Returns true if the script name can be used

Parameters

non-empty-list<string> $argv:

1 call to XdebugHandler::checkMainScript()
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 526

Class

XdebugHandler
@author John Stevenson <john-stevenson@blueyonder.co.uk>

Namespace

Composer\XdebugHandler

Code

private function checkMainScript(string &$mainScript, array $argv) : bool {
    if ($mainScript !== '') {
        // Allow an application to set -- for standard input
        return file_exists($mainScript) || '--' === $mainScript;
    }
    if (file_exists($mainScript = $argv[0])) {
        return true;
    }
    // Use a backtrace to resolve Phar and chdir issues.
    $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
    $main = end($trace);
    if ($main !== false && isset($main['file'])) {
        return file_exists($mainScript = $main['file']);
    }
    return false;
}

API Navigation

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