DebugUtility

Class to handle debug

Table of Contents

Properties

$ansiColorUsage  : bool
$plainTextOutput  : bool

Methods

convertVariableToString()  : string
Converts a variable to a string
debug()  : void
Debug
debugInPopUpWindow()  : void
Opens a debug message inside a popup window
debugRows()  : void
Displays an array as rows in a table. Useful to debug output like an array of database records.
debugTrail()  : string
Displays the "path" of the function call stack in a string, using debug_backtrace
ordinalValue()  : string
Returns a string with a list of ascii-values for the first $characters characters in $string
printArray()  : void
Prints an array
useAnsiColor()  : void
Preset ansi color usage
usePlainTextOutput()  : void
Preset plaintext output
viewArray()  : string
Returns HTML-code, which is a visual representation of a multidimensional array use \TYPO3\CMS\Core\Utility\GeneralUtility::print_array() in order to print an array Returns FALSE if $array_in is not an array
renderDump()  : string
Renders the dump according to the context, either for command line or as HTML output
resolveNonceValue()  : string

Properties

$ansiColorUsage

protected static bool $ansiColorUsage = true

$plainTextOutput

protected static bool $plainTextOutput = true

Methods

convertVariableToString()

Converts a variable to a string

public static convertVariableToString(mixed $variable) : string
Parameters
$variable : mixed
Return values
string

Plain, not HTML encoded string

debug()

Debug

public static debug([mixed $var = '' ][, string $header = 'Debug' ]) : void

Directly echos out debug information as HTML (or plain in CLI context)

Parameters
$var : mixed = ''
$header : string = 'Debug'

debugInPopUpWindow()

Opens a debug message inside a popup window

public static debugInPopUpWindow(mixed $debugVariable[, string $header = 'Debug' ][, string $group = 'Debug' ]) : void
Deprecated

since v12, will be removed in v13.

Parameters
$debugVariable : mixed
$header : string = 'Debug'
$group : string = 'Debug'

debugRows()

Displays an array as rows in a table. Useful to debug output like an array of database records.

public static debugRows(array<string|int, mixed> $rows[, string $header = '' ]) : void
Deprecated

since v12, will be removed in v13.

Parameters
$rows : array<string|int, mixed>

Array of arrays with similar keys

$header : string = ''

Table header

debugTrail()

Displays the "path" of the function call stack in a string, using debug_backtrace

public static debugTrail([bool $prependFileNames = false ]) : string
Parameters
$prependFileNames : bool = false

If set to true file names are added to the output

Return values
string

Plain, not HTML encoded string

ordinalValue()

Returns a string with a list of ascii-values for the first $characters characters in $string

public static ordinalValue(string $string[, int $characters = 100 ]) : string
Parameters
$string : string

String to show ASCII value for

$characters : int = 100

Number of characters to show

Return values
string

The string with ASCII values in separated by a space char.

printArray()

Prints an array

public static printArray(mixed $array_in) : void
Deprecated

since v12, will be removed in v13.

Parameters
$array_in : mixed

Array to print visually (in a table).

Tags
see
viewArray()

useAnsiColor()

Preset ansi color usage

public static useAnsiColor(bool $ansiColorUsage) : void

Warning: This is NOT a public API method and must not be used in own extensions! This method is usually only used in tests to preset the ansi color usage

Parameters
$ansiColorUsage : bool
Internal

usePlainTextOutput()

Preset plaintext output

public static usePlainTextOutput(bool $plainTextOutput) : void

Warning: This is NOT a public API method and must not be used in own extensions! This method is usually only used in tests to preset the output behaviour

Parameters
$plainTextOutput : bool
Internal

viewArray()

Returns HTML-code, which is a visual representation of a multidimensional array use \TYPO3\CMS\Core\Utility\GeneralUtility::print_array() in order to print an array Returns FALSE if $array_in is not an array

public static viewArray(mixed $array_in) : string
Parameters
$array_in : mixed

Array to view

Return values
string

HTML output

renderDump()

Renders the dump according to the context, either for command line or as HTML output

protected static renderDump(mixed $variable[, string $title = '' ][, bool|null $plainText = null ][, bool|null $ansiColors = null ]) : string
Parameters
$variable : mixed
$title : string = ''
$plainText : bool|null = null

Omit or pass null to use the current default.

$ansiColors : bool|null = null

Omit or pass null to use the current default.

Return values
string

resolveNonceValue()

protected static resolveNonceValue() : string
Return values
string

        
On this page

Search results