Fr3nch13/CakePHP Utilities

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
copyright

Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

link

CakePHP(tm) Project

since
0.2.9
license

https://opensource.org/licenses/mit-license.php MIT License

Table of Contents

Constants

DAY  = 86400
HOUR  = 3600
MINUTE  = 60
MONTH  = 2592000
SECOND  = 1
WEEK  = 604800
YEAR  = 31536000

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

MONTH

public mixed MONTH = 2592000

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
link
https://book.cakephp.org/4/en/development/debugging.html#basic-debugging
link
https://book.cakephp.org/4/en/core-libraries/global-constants-and-functions.html#debug
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
link
https://psysh.org/
Return values
string|null

dd()

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.

Tags
link
https://book.cakephp.org/4/en/development/debugging.html#basic-debugging

        
On this page

Search results