Editor PHP 2.4.0

XdebugHandler
in package

Tags
author

John Stevenson john-stevenson@blueyonder.co.uk

phpstan-import-type

restartData from PhpConfig

Table of Contents

Constants

DEBUG  = 'XDEBUG_HANDLER_DEBUG'
RESTART_ID  = 'internal'
RESTART_SETTINGS  = 'XDEBUG_HANDLER_SETTINGS'
SUFFIX_ALLOW  = '_ALLOW_XDEBUG'
SUFFIX_INIS  = '_ORIGINAL_INIS'

Properties

$tmpIni  : string|null

Methods

__construct()  : mixed
Constructor
check()  : void
Checks if Xdebug is loaded and the process needs to be restarted
getAllIniFiles()  : array<int, string>
Returns an array of php.ini locations with at least one entry
getRestartSettings()  : array<string|int, mixed>|null
Returns an array of restart settings or null
getSkippedVersion()  : string
Returns the Xdebug version that triggered a successful restart
isXdebugActive()  : bool
Returns whether Xdebug is loaded and active
setLogger()  : self
Activates status message output to a PSR3 logger
setMainScript()  : self
Sets the main script location if it cannot be called from argv
setPersistent()  : self
Persist the settings to keep Xdebug out of sub-processes
requiresRestart()  : bool
Allows an extending class to decide if there should be a restart
restart()  : void
Allows an extending class to access the tmpIni

Constants

RESTART_SETTINGS

public mixed RESTART_SETTINGS = 'XDEBUG_HANDLER_SETTINGS'

Properties

Methods

__construct()

Constructor

public __construct(string $envPrefix) : mixed

The $envPrefix is used to create distinct environment variables. It is uppercased and prepended to the default base values. For example 'myapp' would result in MYAPP_ALLOW_XDEBUG and MYAPP_ORIGINAL_INIS.

Parameters
$envPrefix : string

Value used in environment variables

Tags
throws
RuntimeException

If the parameter is invalid

check()

Checks if Xdebug is loaded and the process needs to be restarted

public check() : void

This behaviour can be disabled by setting the MYAPP_ALLOW_XDEBUG environment variable to 1. This variable is used internally so that the restarted process is created only once.

getAllIniFiles()

Returns an array of php.ini locations with at least one entry

public static getAllIniFiles() : array<int, string>

The equivalent of calling php_ini_loaded_file then php_ini_scanned_files. The loaded ini location is the first entry and may be an empty string.

Return values
array<int, string>

getRestartSettings()

Returns an array of restart settings or null

public static getRestartSettings() : array<string|int, mixed>|null

Settings will be available if the current process was restarted, or called with the settings from an existing restart.

Tags
phpstan-return

restartData|null

Return values
array<string|int, mixed>|null

getSkippedVersion()

Returns the Xdebug version that triggered a successful restart

public static getSkippedVersion() : string
Return values
string

isXdebugActive()

Returns whether Xdebug is loaded and active

public static isXdebugActive() : bool

true: if Xdebug is loaded and is running in an active mode. false: if Xdebug is not loaded, or it is running with xdebug.mode=off.

Return values
bool

setMainScript()

Sets the main script location if it cannot be called from argv

public setMainScript(string $script) : self
Parameters
$script : string
Return values
self

setPersistent()

Persist the settings to keep Xdebug out of sub-processes

public setPersistent() : self
Return values
self

requiresRestart()

Allows an extending class to decide if there should be a restart

protected requiresRestart(bool $default) : bool

The default is to restart if Xdebug is loaded and its mode is not "off".

Parameters
$default : bool
Return values
bool

restart()

Allows an extending class to access the tmpIni

protected restart(array<int, string> $command) : void
Parameters
$command : array<int, string>

        
On this page

Search results