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

Static Public Member Functions

static debug ($var='', $header='Debug', $group='Debug')
 
static string convertVariableToString ($variable)
 
static debugInPopUpWindow ($debugVariable, $header='Debug', $group='Debug')
 
static string debugTrail ($prependFileNames=false)
 
static debugRows ($rows, $header='')
 
static string ordinalValue ($string, $characters=100)
 
static string viewArray ($array_in)
 
static printArray ($array_in)
 
static usePlainTextOutput ($plainTextOutput)
 
static useAnsiColor ($ansiColorUsage)
 

Static Protected Member Functions

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

Static Protected Attributes

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

Detailed Description

Class to handle debug

Definition at line 24 of file DebugUtility.php.

Member Function Documentation

◆ convertVariableToString()

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

Converts a variable to a string

Parameters
mixed$variable
Returns
‪string plain, not HTML encoded string

Definition at line 81 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 (   $var = '',
  $header = 'Debug',
  $group = 'Debug' 
)
static

◆ debugInPopUpWindow()

static TYPO3\CMS\Core\Utility\DebugUtility::debugInPopUpWindow (   $debugVariable,
  $header = 'Debug',
  $group = 'Debug' 
)
static

Opens a debug message inside a popup window

Parameters
mixed$debugVariable
string$header
string$group

Definition at line 94 of file DebugUtility.php.

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

◆ debugRows()

static TYPO3\CMS\Core\Utility\DebugUtility::debugRows (   $rows,
  $header = '' 
)
static

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

Parameters
mixed$rows‪Array of arrays with similar keys
string$header‪Table header

Definition at line 164 of file DebugUtility.php.

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

◆ debugTrail()

static string TYPO3\CMS\Core\Utility\DebugUtility::debugTrail (   $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 140 of file DebugUtility.php.

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

◆ ordinalValue()

static string TYPO3\CMS\Core\Utility\DebugUtility::ordinalValue (   $string,
  $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 176 of file DebugUtility.php.

◆ printArray()

static TYPO3\CMS\Core\Utility\DebugUtility::printArray (   $array_in)
static

Prints an array

Parameters
mixed$array_in‪Array to print visually (in a table).
See also
viewArray()

Definition at line 207 of file DebugUtility.php.

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

◆ renderDump()

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

◆ useAnsiColor()

◆ usePlainTextOutput()

static TYPO3\CMS\Core\Utility\DebugUtility::usePlainTextOutput (   $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

Parameters
bool$plainTextOutput

Definition at line 238 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 (   $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 196 of file DebugUtility.php.

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

Referenced by TYPO3\CMS\Core\Database\QueryView\getQueryResultCode().

Member Data Documentation

◆ $ansiColorUsage

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

◆ $plainTextOutput

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