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
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
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

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'

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.

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

        
On this page

Search results