Class yii\debug\Module

Inheritanceyii\debug\Module » yii\base\Module
Implementsyii\base\BootstrapInterface
Available since version2.0

The Yii Debug Module provides the debug toolbar and debugger

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$allowedHosts array The list of hosts that are allowed to access this module. yii\debug\Module
$allowedIPs array The list of IPs that are allowed to access this module. yii\debug\Module
$controllerNamespace yii\debug\Module
$dataPath string The directory storing the debugger data files. yii\debug\Module
$defaultPanel string The name of the panel that should be visible when opening the debug panel. yii\debug\Module
$dirMode integer The permission to be set for newly created directories. yii\debug\Module
$enableDebugLogs boolean Whether to enable message logging for the requests about debug module actions. yii\debug\Module
$fileMode integer The permission to be set for newly created debugger data files. yii\debug\Module
$historySize integer The maximum number of debug data files to keep. yii\debug\Module
$logTarget yii\debug\LogTarget yii\debug\Module
$panels array|yii\debug\Panel[] List of debug panels. yii\debug\Module
$traceLine mixed The string with placeholders to be be substituted or an anonymous function that returns the trace line string. yii\debug\Module

Public Methods

Hide inherited methods

MethodDescriptionDefined By
beforeAction() yii\debug\Module
bootstrap() yii\debug\Module
getToolbarHtml() Gets toolbar HTML yii\debug\Module
getYiiLogo() Returns the logo URL to be used in <img src=" yii\debug\Module
init() yii\debug\Module
renderToolbar() Renders mini-toolbar at the end of page body. yii\debug\Module
setDebugHeaders() Setting headers to transfer debug data in AJAX requests without interfering with the request itself. yii\debug\Module
setYiiLogo() Sets the logo URL to be used in <img src=" yii\debug\Module

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
checkAccess() Checks if current user is allowed to access the module yii\debug\Module
corePanels() yii\debug\Module
defaultVersion() yii\debug\Module
initPanels() Initializes panels. yii\debug\Module
resetGlobalSettings() Resets potentially incompatible global settings done in app config. yii\debug\Module

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
DEFAULT_IDE_TRACELINE '{text}' yii\debug\Module

Property Details

$allowedHosts public property

The list of hosts that are allowed to access this module. Each array element is a hostname that will be resolved to an IP address that is compared with the IP address of the user. A use case is to use a dynamic DNS (DDNS) to allow access. The default value is [].

public array $allowedHosts = []
$allowedIPs public property

The list of IPs that are allowed to access this module. Each array element represents a single IP filter which can be either an IP address or an address with wildcard (e.g. 192.168.0.*) to represent a network segment. The default value is ['127.0.0.1', '::1'], which means the module can only be accessed by localhost.

public array $allowedIPs = ['127.0.0.1''::1']
$controllerNamespace public property
public $controllerNamespace 'yii\debug\controllers'
$dataPath public property

The directory storing the debugger data files. This can be specified using a path alias.

public string $dataPath '@runtime/debug'
$defaultPanel public property (available since version 2.0.7)

The name of the panel that should be visible when opening the debug panel. The default value is 'log'.

public string $defaultPanel 'log'
$dirMode public property (available since version 2.0.6)

The permission to be set for newly created directories. This value will be used by PHP \yii\debug\chmod() function. No umask will be applied. Defaults to 0775, meaning the directory is read-writable by owner and group, but read-only for other users.

public integer $dirMode 0775
$enableDebugLogs public property

Whether to enable message logging for the requests about debug module actions. You normally do not want to keep these logs because they may distract you from the logs about your applications. You may want to enable the debug logs if you want to investigate how the debug module itself works.

public boolean $enableDebugLogs false
$fileMode public property (available since version 2.0.6)

The permission to be set for newly created debugger data files. This value will be used by PHP \yii\debug\chmod() function. No umask will be applied. If not set, the permission will be determined by the current environment.

public integer $fileMode null
$historySize public property

The maximum number of debug data files to keep. If there are more files generated, the oldest ones will be removed.

public integer $historySize 50
$logTarget public property
$panels public property

List of debug panels. The array keys are the panel IDs, and values are the corresponding panel class names or configuration arrays. This will be merged with corePanels(). You may reconfigure a core panel via this property by using the same panel ID. You may also disable a core panel by setting it to be false in this property.

$traceLine public property (available since version 2.0.7)

The string with placeholders to be be substituted or an anonymous function that returns the trace line string. The placeholders are {file}, {line} and {text} and the string should be as follows:

File: {file} - Line: {line} - Text: {text}

The signature of the anonymous function should be as follows:

function($trace, $panel) {
    // compute line string
    return $line;
}
public mixed $traceLine self::DEFAULT_IDE_TRACELINE

Method Details

beforeAction() public method

public void beforeAction ( $action )
$action
bootstrap() public method

public void bootstrap ( $app )
$app
checkAccess() protected method

Checks if current user is allowed to access the module

protected boolean checkAccess ( )
return boolean

If access is granted

corePanels() protected method

protected array corePanels ( )
return array

Default set of panels

defaultVersion() protected method (available since version 2.0.7)

protected void defaultVersion ( )
getToolbarHtml() public method (available since version 2.0.7)

Gets toolbar HTML

public void getToolbarHtml ( )
getYiiLogo() public static method

Returns the logo URL to be used in <img src="

public static string getYiiLogo ( )
return string

The logo URL

init() public method

public void init ( )
initPanels() protected method

Initializes panels.

protected void initPanels ( )
renderToolbar() public method

Renders mini-toolbar at the end of page body.

public void renderToolbar ( $event )
$event \yii\base\Event
resetGlobalSettings() protected method

Resets potentially incompatible global settings done in app config.

protected void resetGlobalSettings ( )
setDebugHeaders() public method (available since version 2.0.7)

Setting headers to transfer debug data in AJAX requests without interfering with the request itself.

public void setDebugHeaders ( $event )
$event \yii\base\Event
setYiiLogo() public static method

Sets the logo URL to be used in <img src="

public static void setYiiLogo ( $logo )
$logo string

The logo URL