vendor/cakephp/cakephp/srcbasics.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.

Constants

SECOND

SECOND = 1

Basic defines for timing functions.

MINUTE

MINUTE = 60

HOUR

HOUR = 3600

DAY

DAY = 86400

WEEK

WEEK = 604800

MONTH

MONTH = 2592000

YEAR

YEAR = 31536000

Functions

debug()

debug(mixed  $var, boolean|null  $showHtml = null, boolean  $showFrom = true) : mixed

Prints out debug information about given variable and returns the variable that was passed.

Only runs if debug mode is enabled.

Parameters

mixed $var

Variable to show debug information for.

boolean|null $showHtml

If set to true, the method prints the debug data in a browser-friendly way.

boolean $showFrom

If set to true, the method prints from where the function was called.

Returns

mixed —

The same $var that was passed

stackTrace()

stackTrace(array  $options = array()) : mixed

Outputs a stack trace based on the supplied options.

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

array $options

Format for outputting stack trace

Returns

mixed —

Formatted stack trace

breakpoint()

breakpoint() : string

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

Returns

string

dd()

dd(mixed  $var, boolean|null  $showHtml = null) : void

Prints out debug information about given variable and dies.

Only runs if debug mode is enabled. It will otherwise just continue code execution and ignore this function.

Parameters

mixed $var

Variable to show debug information for.

boolean|null $showHtml

If set to true, the method prints the debug data in a browser-friendly way.

loadPHPUnitAliases()

loadPHPUnitAliases() : void

Loads PHPUnit aliases

This is an internal function used for backwards compatibility during fixture related tests.