‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Utility\DebugUtility Class Reference

Static Public Member Functions

static debug (mixed $var='', string $header='Debug')
 
static string convertVariableToString (mixed $variable)
 
static string debugTrail (bool $prependFileNames=false)
 
static string ordinalValue (string $string, int $characters=100)
 
static string viewArray (mixed $array_in)
 
static usePlainTextOutput (bool $plainTextOutput)
 
static useAnsiColor (bool $ansiColorUsage)
 

Static Protected Member Functions

static renderDump (mixed $variable, string $title='', ?bool $plainText=null, ?bool $ansiColors=null)
 

Static Protected Attributes

static bool $plainTextOutput = true
 
static bool $ansiColorUsage = true
 

Detailed Description

Class to handle debug

Definition at line 26 of file DebugUtility.php.

Member Function Documentation

◆ convertVariableToString()

static string TYPO3\CMS\Core\Utility\DebugUtility::convertVariableToString ( mixed  $variable)
static

Converts a variable to a string

Returns
‪string Plain, not HTML encoded string

Definition at line 52 of file DebugUtility.php.

References TYPO3\CMS\Core\Utility\DebugUtility\renderDump().

Referenced by TYPO3\CMS\Core\Tests\Unit\Utility\DebugUtilityTest\convertVariableToStringReturnsVariableContent().

◆ debug()

static TYPO3\CMS\Core\Utility\DebugUtility::debug ( mixed  $var = '',
string  $header = 'Debug' 
)
static

◆ debugTrail()

static string TYPO3\CMS\Core\Utility\DebugUtility::debugTrail ( bool  $prependFileNames = false)
static

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

Parameters
bool$prependFileNames‪If set to true file names are added to the output
Returns
‪string Plain, not HTML encoded string

Definition at line 64 of file DebugUtility.php.

References TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix().

Referenced by TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_htmlSanitize().

◆ ordinalValue()

static string TYPO3\CMS\Core\Utility\DebugUtility::ordinalValue ( string  $string,
int  $characters = 100 
)
static

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

Parameters
string$stringString to show ASCII value for
int$characters‪Number of characters to show
Returns
‪string The string with ASCII values in separated by a space char.

Definition at line 93 of file DebugUtility.php.

◆ renderDump()

static TYPO3\CMS\Core\Utility\DebugUtility::renderDump ( mixed  $variable,
string  $title = '',
?bool  $plainText = null,
?bool  $ansiColors = null 
)
staticprotected

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

Parameters
bool | null$plainText‪Omit or pass null to use the current default.
bool | null$ansiColors‪Omit or pass null to use the current default.

Definition at line 124 of file DebugUtility.php.

References TYPO3\CMS\Core\Utility\DebugUtility\$ansiColorUsage, TYPO3\CMS\Core\Utility\DebugUtility\$plainTextOutput, TYPO3\CMS\Core\Core\Environment\isCli(), and TYPO3\CMS\Extbase\Utility\DebuggerUtility\var_dump().

Referenced by TYPO3\CMS\Core\Utility\DebugUtility\convertVariableToString(), TYPO3\CMS\Core\Utility\DebugUtility\debug(), and TYPO3\CMS\Core\Utility\DebugUtility\viewArray().

◆ useAnsiColor()

◆ usePlainTextOutput()

static TYPO3\CMS\Core\Utility\DebugUtility::usePlainTextOutput ( bool  $plainTextOutput)
static

Preset plaintext output

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

Definition at line 140 of file DebugUtility.php.

References TYPO3\CMS\Core\Utility\DebugUtility\$plainTextOutput.

Referenced by TYPO3\CMS\Core\Tests\Unit\Utility\DebugUtilityTest\debugEncodesHtmlInputIfNoPlainText(), TYPO3\CMS\Core\Tests\Unit\Utility\DebugUtilityTest\debugNotEncodesHtmlInputIfPlainText(), and TYPO3\CMS\Core\Tests\Unit\Utility\DebugUtilityTest\tearDown().

◆ viewArray()

static string TYPO3\CMS\Core\Utility\DebugUtility::viewArray ( mixed  $array_in)
static

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

Parameters
mixed$array_in‪Array to view
Returns
‪string HTML output

Definition at line 113 of file DebugUtility.php.

References TYPO3\CMS\Core\Utility\DebugUtility\renderDump().

Referenced by TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\getData(), and TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController\getQueryResultCode().

Member Data Documentation

◆ $ansiColorUsage

bool TYPO3\CMS\Core\Utility\DebugUtility::$ansiColorUsage = true
staticprotected

◆ $plainTextOutput

bool TYPO3\CMS\Core\Utility\DebugUtility::$plainTextOutput = true
staticprotected