TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
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 ($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

static 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 DebugUtilityTest\convertVariableToStringReturnsVariableContent().

static debug (   $var = '',
  $header = '',
  $group = 'Debug' 
)
static

Debug

Directly echos out debug information as HTML (or plain in CLI context)

Parameters
string$var
string$header
string$group

Definition at line 42 of file DebugUtility.php.

References GeneralUtility\quoteJSvalue(), and GeneralUtility\wrapJS().

Referenced by debug(), DatabaseConnection\debug(), DebugUtilityTest\debugEncodesHtmlInputIfNoPlainText(), DebugUtilityTest\debugNotEncodesHtmlInputIfPlainText(), GeneralUtility\deprecationLog(), and xdebug().

static 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 GeneralUtility\quoteJSvalue(), and GeneralUtility\wrapJS().

static 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().

static 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 PathUtility\stripPathSitePrefix().

Referenced by DatabaseConnection\debug(), and GeneralUtility\logDeprecatedFunction().

static isCommandLine ( )
staticprotected

Checks some constants to determine if we are in CLI context

Returns
bool

Definition at line 233 of file DebugUtility.php.

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

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

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

References DebuggerUtility\var_dump().

static useAnsiColor (   $ansiColorUsage)
static
static 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 248 of file DebugUtility.php.

References DebugUtility\$plainTextOutput.

Referenced by DebugUtilityTest\debugEncodesHtmlInputIfNoPlainText(), DebugUtilityTest\debugNotEncodesHtmlInputIfPlainText(), and DebugUtilityTest\tearDown().

static 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 ContentObjectRenderer\getData(), GeneralUtility\makeInstanceService(), and ExtDirectDebug\toString().

Member Data Documentation

$ansiColorUsage = true
staticprotected

Definition at line 31 of file DebugUtility.php.

Referenced by DebugUtility\useAnsiColor().

$plainTextOutput = true
staticprotected

Definition at line 26 of file DebugUtility.php.

Referenced by DebugUtility\usePlainTextOutput().