TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Utility\DebugUtility Class Reference

Static Public Member Functions

static debug ($var='', $header='', $group='Debug')
 
static convertVariableToString ($variable)
 
static debugInPopUpWindow ($debugVariable, $header='Debug', $group='Debug')
 
static debugTrail ()
 
static debugRows ($rows, $header='', $returnHTML=false)
 
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 = '',
  $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 = '',
  $returnHTML = false 
)
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
bool$returnHTMLIf TRUE, will return content instead of echo'ing out. Deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8

Definition at line 162 of file DebugUtility.php.

References debug(), and TYPO3\CMS\Core\Utility\GeneralUtility\deprecationLog().

◆ debugTrail()

static TYPO3\CMS\Core\Utility\DebugUtility::debugTrail ( )
static

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

Returns
string plain, not HTML encoded string

Definition at line 138 of file DebugUtility.php.

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

Referenced by TYPO3\CMS\Core\Database\DatabaseConnection\explain(), 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 235 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 177 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).
Returns
void
See also
viewArray()

Definition at line 209 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 223 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 250 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 197 of file DebugUtility.php.

Referenced by TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\getData(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstanceService(), TYPO3\CMS\Dbal\Controller\ModuleController\printLogMgm(), TYPO3\CMS\Core\TimeTracker\TimeTracker\printTSlog(), 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