basics.php
CakePHP(tm) : Rapid Development Framework (https://cakephp.org) Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt Redistributions of files must retain the above copyright notice.
Tags
Table of Contents
Constants
Functions
- debug() : mixed
- Prints out debug information about given variable and returns the variable that was passed.
- stackTrace() : void
- Outputs a stack trace based on the supplied options.
- breakpoint() : string|null
- Command to return the eval-able code to startup PsySH in interactive debugger Works the same way as eval(\Psy\sh()); psy/psysh must be loaded in your project
- dd() : void
- Prints out debug information about given variable and dies.
Constants
DAY
public
mixed
DAY
= 86400
HOUR
public
mixed
HOUR
= 3600
MINUTE
public
mixed
MINUTE
= 60
MONTH
public
mixed
MONTH
= 2592000
SECOND
public
mixed
SECOND
= 1
WEEK
public
mixed
WEEK
= 604800
YEAR
public
mixed
YEAR
= 31536000
Functions
debug()
Prints out debug information about given variable and returns the variable that was passed.
debug(mixed $var[, bool|null $showHtml = null ][, bool $showFrom = true ]) : mixed
Only runs if debug mode is enabled.
Parameters
- $var : mixed
-
Variable to show debug information for.
- $showHtml : bool|null = null
-
If set to true, the method prints the debug data in a browser-friendly way.
- $showFrom : bool = true
-
If set to true, the method prints from where the function was called.
Tags
Return values
mixed —The same $var that was passed
stackTrace()
Outputs a stack trace based on the supplied options.
stackTrace([array<string, mixed> $options = [] ]) : void
Options
-
depth
- The number of stack frames to return. Defaults to 999 -
args
- Should arguments for functions be shown? If true, the arguments for each method call will be displayed. -
start
- The stack frame to start generating a trace from. Defaults to 1
Parameters
- $options : array<string, mixed> = []
-
Format for outputting stack trace
breakpoint()
Command to return the eval-able code to startup PsySH in interactive debugger Works the same way as eval(\Psy\sh()); psy/psysh must be loaded in your project
breakpoint() : string|null
eval(breakpoint());
Tags
Return values
string|nulldd()
Prints out debug information about given variable and dies.
dd(mixed $var[, bool|null $showHtml = null ]) : void
Only runs if debug mode is enabled. It will otherwise just continue code execution and ignore this function.
Parameters
- $var : mixed
-
Variable to show debug information for.
- $showHtml : bool|null = null
-
If set to true, the method prints the debug data in a browser-friendly way.