TYPO3 CMS  TYPO3_8-7
TYPO3\CMS\Core\Utility\DebugUtility Class Reference

Static Public Member Functions

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

Static Protected Member Functions

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

Static Protected Attributes

static $plainTextOutput = true
 
static $ansiColorUsage = true
 

Detailed Description

Class to handle debug

Definition at line 21 of file DebugUtility.php.

Member Function Documentation

◆ convertVariableToString()

static 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 80 of file DebugUtility.php.

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 93 of file DebugUtility.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\quoteJSvalue(), and TYPO3\CMS\Core\Utility\GeneralUtility\wrapJS().

◆ 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$rowsArray of arrays with similar keys
string$headerTable header

Definition at line 163 of file DebugUtility.php.

References debug().

◆ debugTrail()

static 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$prependFileNamesIf set to true file names are added to the output
Returns
string plain, not HTML encoded string

Definition at line 139 of file DebugUtility.php.

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

Referenced by TYPO3\CMS\Core\Database\DatabaseConnection\debug(), TYPO3\CMS\Core\Database\DatabaseConnection\debug_check_recordset(), and TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction().

◆ isCommandLine()

static TYPO3\CMS\Core\Utility\DebugUtility::isCommandLine ( )
staticprotected

Checks some constants to determine if we are in CLI context

Returns
bool

Definition at line 232 of file DebugUtility.php.

◆ ordinalValue()

static 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$charactersNumber of characters to show
Returns
string The string with ASCII values in separated by a space char.

Definition at line 175 of file DebugUtility.php.

◆ printArray()

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

Prints an array

Parameters
mixed$array_inArray to print visually (in a table).
See also
viewArray()

Definition at line 206 of file DebugUtility.php.

◆ renderDump()

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

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

Parameters
mixed$variable
string$title
bool | null$plainText
bool | null$ansiColors
Returns
string

Definition at line 220 of file DebugUtility.php.

References TYPO3\CMS\Extbase\Utility\DebuggerUtility\var_dump().

◆ 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

Definition at line 247 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 TYPO3\CMS\Core\Utility\DebugUtility::viewArray (   $array_in)
static

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

Parameters
mixed$array_inArray to view
Returns
string HTML output

Definition at line 195 of file DebugUtility.php.

Referenced by TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\getData(), TYPO3\CMS\Core\Database\QueryView\getQueryResultCode(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstanceService(), and TYPO3\CMS\Core\ExtDirect\ExtDirectDebug\toString().

Member Data Documentation

◆ $ansiColorUsage

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

Definition at line 31 of file DebugUtility.php.

Referenced by TYPO3\CMS\Core\Utility\DebugUtility\useAnsiColor().

◆ $plainTextOutput

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