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\XdebugHandlerCode
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;
}