DebugUtility

Class to handle debug

Table of Contents

Properties

$ansiColorUsage  : bool
$plainTextOutput  : bool

Methods

convertVariableToString()  : string
Converts a variable to a string
debug()  : mixed
Debug
debugInPopUpWindow()  : mixed
Opens a debug message inside a popup window
debugRows()  : mixed
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()  : mixed
Prints an array
useAnsiColor()  : mixed
Preset ansi color usage
usePlainTextOutput()  : mixed
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

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([string $var = '' ][, string $header = 'Debug' ][, string $group = 'Debug' ]) : mixed

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

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

debugInPopUpWindow()

Opens a debug message inside a popup window

public static debugInPopUpWindow(mixed $debugVariable[, string $header = 'Debug' ][, string $group = 'Debug' ]) : mixed
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(mixed $rows[, string $header = '' ]) : mixed
Parameters
$rows : 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) : mixed
Parameters
$array_in : mixed

Array to print visually (in a table).

Tags
see
viewArray()

useAnsiColor()

Preset ansi color usage

public static useAnsiColor(bool $ansiColorUsage) : mixed

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) : mixed

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
$ansiColors : bool|null = null
Return values
string

        
On this page

Search results