Skip to content

Latest commit

 

History

History
161 lines (118 loc) · 3.01 KB

File metadata and controls

161 lines (118 loc) · 3.01 KB

Debug


constructionTime

returns time passed from start until calling this method.

Debug::constructionTime() : float

available shorthand function

ct() : float

display

on Frontend, multiple display usages are stacked on top of each other. Each display debug has a count number for better identifying.

The source file, line and class/method infos from where the display command was called are shown.

Debug::display(mixed $mData = '', array $aDebugBacktrace = array()) : void

available shorthand function

display(mixed $mData = '', array $aDebugBacktrace = array()) : void

Frontend
Debug::display()

CLI
Debug::display()


info

dumps Data. The source file, line and class/method infos from where the info command was called are shown.

Debug::info(mixed $mData = '', array $aDebugBacktrace = array()) : void

available shorthand function

info(mixed $mData = '', array $aDebugBacktrace = array()) : void

Example

info($this);

Frontend
Debug::info()

CLI
Debug::info()


prepareBacktraceArray

returns an array containing information about the source of the call which leads to this place.

Debug::prepareBacktraceArray(array $aBacktrace = array()) : array

Example

$aDebug = Debug::prepareBacktraceArray(
    debug_backtrace()
);

Result of $aDebug

// type: array, items: 4
[
    'sFile' => '/var/www/html/application/library/MVC/Reflex.php',
    'sLine' => 140,
    'sClass' => 'MVC\\Reflex',
    'sFunction' => 'reflect',
]

stop

available shorthand function

stop();

Non-shorthand, offering options

Debug::stop(mixed $mData = '', bool $bShowWhereStop = true, bool $bDump = true, array $aBacktrace = array()) : void

Example

stop();
stop at:
- File: /var/www/htdocs/Emvicy/modules/Foo/Controller/Index.php
- Line: 100
- Method: Foo\Controller\Index::index

Example

Debug::stop('here i stopped');

Frontend
Debug::display()

CLI
Debug::display()


varExport

Debug::varExport(mixed $mData, bool $bReturn = false, bool $bShortArraySyntax = true)

Examples

equals var_export(), except that arrays are noted with square brackets [ ]

Debug::varExport($GLOBALS['aConfig']);

equals var_export()

Debug::varExport($GLOBALS['aConfig'], bShortArraySyntax: false);

returns output

$aExport = Debug::varExport($GLOBALS['aConfig'], true);