Download the PHP package dgoriaev/yii2-debug without Composer
On this page you can find all versions of the php package dgoriaev/yii2-debug. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dgoriaev/yii2-debug
More information about dgoriaev/yii2-debug
Files in dgoriaev/yii2-debug
Package yii2-debug
Short Description Yii2 debug toolbar ported to Yii1
License BSD-3-Clause
Homepage https://github.com/dplusg/yii2-debug
Informations about the package yii2-debug
yii2-debug
Debug panel for Yii 1.1 (ported from Yii 2).
Installation
This extension is available at packagist.org and can be installed via composer by following command:
composer require --dev dgoriaev/yii2-debug
.
If you want to install this extension manually just copy sources to /protected/extensions
directory.
To enable toolbar in your application add following lines to config:
Configuration
You can customize debug panel behavior with this options:
enabled
- enable/disable debug panel.allowedIPs
- list of IPs that are allowed to access debug toolbar. Defaultarray('127.0.0.1', '::1')
.accessExpression
- additional php expression for access evaluation.logPath
- directory storing the debugger data files. This can be specified using a path alias. Default/runtime/debug
.historySize
- maximum number of debug data files to keep. If there are more files generated, the oldest ones will be removed.highlightCode
- highlight code. Highlight SQL queries and PHP variables. This parameter can be set for each panel individually.moduleId
- module ID for viewing stored debug logs. Defaultdebug
.showConfig
- show brief application configuration page. Defaultfalse
.hiddenConfigOptions
- list of unsecure component options to hide (like login, passwords, secret keys). Default is to hideusername
andpassword
ofdb
component.internalUrls
- use nice routes rules in debug module.panels
- list of debug panels.
Each attached panel can be configured individually, for example:
Each panel have callback option filterData
.
You can define custom function for filtering input data before writing it in to debug log.
It's useful when you need to hide something secret or just delete data from logs.
Be careful with data structure manipulation. It can lead to log parsing errors.
Example:
Creating own panels
To create own debug panel you can extend class Yii2DebugPanel
, for example:
And attach this panel in config:
Disable individual panels
To disable an individual panel, either a core or custom panel, set the enabled
property in the panel config to false
.
Example: Disable core profiling
panel
Variables dumping
With static method Yii2Debug::dump()
you can dump any data and examine it later in debug log.
Miscellaneous
Status Code
If you using PHP < 5.4, debug panel can't detect redirects by himself. You can use following code as workaround:
Such code just set 302 code if Location
header is present.
Codes like 4xx and 5xx can be detected in debug panel by himself.
In PHP 5.4 and higher debug panel uses native php function http_response_code()
for detecting http response code,
and there is no need to use this workaround.