CLASS OPTIONS
This is the full list of options available on intialization, stored in PtcDebug::$_defaultOptions property:
$options=array // add some options before class initialization
(
'url_key' => 'debug', // the key to pass to the url to turn on debug
'url_pass' => 'true', // the pass to turn on debug
'replace_error_handler' => true, // replace default php error handler
'error_reporting' => E_ALL, // error reporting flag
'catch_exceptions' => true, // sets exception handler to be this class method
'check_referer' => false, // check referer for key and pass(good for ajax debugging)
'die_on_error' => true, // die if fatal error occurs(with this class error handler)
'debug_console' => false, // only for Chrome,show messages in console(phpConsole needed)
'allowed_ips' => null, // restrict access with ip's
'session_start' => false, // start session for persistent debugging
'show_interface' => true, // show the interface(false to debug in console only)
'enable_inspector' => true, // enable variables inspector, use declare(ticks=n); in code block
'declare_ticks' => false, // declare ticks globally with value of 1
'set_time_limit' => null, // set php execution time limit
'memory_limit' => null, // set php memory size
'show_messages' => true, // show messages panel
'show_globals' => true, // show global variables in vars panel
'show_sql' => true, // show sql panel
'trace_depth' => 10, // maximum depth for the backtrace
'max_dump_depth' => 6, // maximum depth for the dump function
'default_category' => 'General'
);
The next chapters will explain in details the usage of these options.
url_key
To show the interface we use a "$_GET" parameter in the url (see url_pass),
and to turn it off the same parameter + "_off" is used. The default key is "debug" and should be changed to something else!
Default value: debug (string)
url_pass
The value to pass in the url (see url_key), the default value is "true"
and should be changed to something else!
Default value: true (string)
replace_error_handler
Replaces the default php error handler to show php errors in the debug messages panel.
Default value: true (bool)
check_referer
This option, if set to "true", will check for the "url_key" and
"url_pass" with the referer if any. This is quite usefull to debug ajax scripts with the
"show_interface" option set to "false",
and the debug_console set to "true".
See Ajax debugging (chrome only) for more information on this setup.
Default value: false (bool)
die_on_error
Set this option to false to continue if fatal error occurs, keep in mind that this will only work with the
"replace_error_handler" option set to "true".
Default value: true (bool)
debug_console
Only for Chrome,with phpConsole class installed.This feature is usefull to to debug ajax scripts.
See Ajax debugging (chrome only) for more information and detailed usage.
Default value: false (bool)
allowed_ips
To restrict access use this option to pass an ip or an array of ip's,
and only the allowed ip's will be able to turn on/off the debug interface. It is advised to use this option under production environment.
Default value: null (string|array)
session_start
For persistent debugging, set this option to true, and the class will try to store the "url_key"
and "url_pass" in a "$_SESSION" var.
You will need to use "url_key"+_off to hide the interface.
While this is a good option to navigate an application, it will not work if the class is not initialized at very start of the application.
see session_start() function for more information.
Default value: false (bool)
show_interface
This option, if set to "false", does not show the floating panel. It is usefull to send messages to console only with the option
"debug_console" set to "true".
See Ajax debugging (chrome only) for more details over this setup.
Default value: true (bool)
enable_inspector
This option, enables the variable inspector, which can be used to watch if a given variable has changed.
Remember to declare ticks in a code block or use the option "declare_ticks".
See INSPECTING VARIABLE CHANGES for examples.
Default value: true (bool)
declare_ticks
If the option "enable_inspector" is set to "true",
this option can be used to declare ticks globally. Keep in mind that it is adviced to declare ticks inside a code block, as the backtrace might not be as precise.
See INSPECTING VARIABLE CHANGES for example usage.
Default value: false (bool)
set_time_limit
Sets the php global execution time limit.
Default value: null (float)
memory_limit
Sets memory limit for php.
Default value: null (float)
show_messages
Controls if the messages panel will be shown, if set to "false" the interface will not show this panel and will be faster to load.
This option can be turned on and off with the "$_GET" parameter "hidepanels" in the url,
see HIDING PANELS for more information about this option.
Default value: true (bool)
show_globals
Controls if the "$GLOBALS" variable will be shown in the vars panel,
if set to "false" the interface will not show the "$GLOBALS" and will be faster to load.
This option can be turned on and off with the "$_GET" parameter "hidepanels" in the url,
see HIDING PANELS for more information about this option.
Default value: true (bool)
show_sql
This option, controls if the sql panel will be shown in the sql panel,
if set to "false" the interface will not show this panel and will be faster to load.
This option can be turned on and off with the "$_GET" parameter "hidepanels" in the url,
see HIDING PANELS for more information about this option.
Default value: true (bool)
trace_depth
This option sets a depth limit for the backtrace. Increase it if you think that the backtrace is leaving out files.
Default value: 10 (float)
max_dump_depth
This option sets the maximum depth when dumping variables to prevent recursion. If maximum depth is reached,
the message "**MAX DEPTH REACHED** " will be shown. Increase it if you need a higher depth.
Default value: 6 (float)
default_category
The default category for the log/sql messages.
Default value: General (string)