PHP Class yii\debug\Module

Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends yii\base\Module, implements yii\base\BootstrapInterface
Datei anzeigen Open project: yiisoft/yii2-debug Class Usage Examples

Public Properties

Property Type Description
$allowedHosts 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 [].
$allowedIPs 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.
$controllerNamespace
$dataPath the directory storing the debugger data files. This can be specified using a path alias.
$defaultPanel the name of the panel that should be visible when opening the debug panel. The default value is 'log'.
$dirMode the permission to be set for newly created directories. This value will be used by PHP [[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.
$enableDebugLogs 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.
$fileMode the permission to be set for newly created debugger data files. This value will be used by PHP [[chmod()]] function. No umask will be applied. If not set, the permission will be determined by the current environment.
$historySize the maximum number of debug data files to keep. If there are more files generated, the oldest ones will be removed.
$logTarget LogTarget
$panels 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 Module::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 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: php function($trace, $panel) { compute line string return $line; }

Public Methods

Method Description
beforeAction ( $action )
bootstrap ( $app )
getToolbarHtml ( ) Gets toolbar HTML
getYiiLogo ( ) : string Returns the logo URL to be used in
init ( )
renderToolbar ( Event $event ) Renders mini-toolbar at the end of page body.
setDebugHeaders ( Event $event ) Setting headers to transfer debug data in AJAX requests without interfering with the request itself.
setYiiLogo ( string $logo ) Sets the logo URL to be used in

Protected Methods

Method Description
checkAccess ( ) : boolean Checks if current user is allowed to access the module
corePanels ( ) : array
defaultVersion ( )
initPanels ( ) Initializes panels.
resetGlobalSettings ( ) Resets potentially incompatible global settings done in app config.

Method Details

beforeAction() public method

public beforeAction ( $action )

bootstrap() public method

public bootstrap ( $app )

checkAccess() protected method

Checks if current user is allowed to access the module
protected checkAccess ( ) : boolean
return boolean if access is granted

corePanels() protected method

protected corePanels ( ) : array
return array default set of panels

defaultVersion() protected method

Since: 2.0.7
protected defaultVersion ( )

getToolbarHtml() public method

Gets toolbar HTML
Since: 2.0.7
public getToolbarHtml ( )