‪TYPO3CMS  9.5
TYPO3\CMS\Extbase\Utility\DebuggerUtility Class Reference

Static Public Member Functions

static string var_dump ($variable, $title=null, $maxDepth=8, $plainText=false, $ansiColors=true, $return=false, $blacklistedClassNames=null, $blacklistedPropertyNames=null)
 

Public Attributes

const PLAINTEXT_INDENT = ' '
 
const HTML_INDENT = '   '
 

Static Protected Member Functions

static clearState ()
 
static string renderDump ($value, $level, $plainText, $ansiColors)
 
static string renderArray ($array, $level, $plainText=false, $ansiColors=false)
 
static string renderObject ($object, $level, $plainText=false, $ansiColors=false)
 
static string renderClosure ($object, $level, $plainText=false, $ansiColors=false)
 
static bool isBlacklisted ($value)
 
static bool isAlreadyRendered ($object)
 
static string renderHeader ($object, $level, $plainText, $ansiColors)
 
static string renderContent ($object, $level, $plainText, $ansiColors)
 
static string renderCollection ($collection, $level, $plainText, $ansiColors)
 
static string ansiEscapeWrap ($string, $ansiColors, $enable=true)
 

Static Protected Attributes

static TYPO3 CMS Extbase Persistence ObjectStorage $renderedObjects
 
static array $blacklistedClassNames
 
static array $blacklistedPropertyNames = array( 'warning' )
 
static bool $stylesheetEchoed = false
 
static int $maxDepth = 8
 

Detailed Description

This class is a backport of the corresponding class of TYPO3 Flow. All credits go to the TYPO3 Flow team.

A debugging utility class

Definition at line 23 of file DebuggerUtility.php.

Member Function Documentation

◆ ansiEscapeWrap()

static string TYPO3\CMS\Extbase\Utility\DebuggerUtility::ansiEscapeWrap (   $string,
  $ansiColors,
  $enable = true 
)
staticprotected

Wrap a string with the ANSI escape sequence for colorful output

Parameters
string$string‪The string to wrap
string$ansiColors‪The ansi color sequence (e.g. "1;37")
bool$enable‪If FALSE, the raw string will be returned
Returns
‪string The wrapped or raw string

Definition at line 475 of file DebuggerUtility.php.

Referenced by TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderArray(), TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderDump(), and TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderHeader().

◆ clearState()

static TYPO3\CMS\Extbase\Utility\DebuggerUtility::clearState ( )
staticprotected

Clear the state of the debugger

Definition at line 67 of file DebuggerUtility.php.

◆ isAlreadyRendered()

static bool TYPO3\CMS\Extbase\Utility\DebuggerUtility::isAlreadyRendered (   $object)
staticprotected

Checks if a given object was already rendered.

Parameters
object$object
Returns
‪bool TRUE if the given object was already rendered

Definition at line 226 of file DebuggerUtility.php.

◆ isBlacklisted()

static bool TYPO3\CMS\Extbase\Utility\DebuggerUtility::isBlacklisted (   $value)
staticprotected

Checks if a given object or property should be excluded/filtered

Parameters
object$value‪An ReflectionProperty or other Object
Returns
‪bool TRUE if the given object should be filtered

Definition at line 209 of file DebuggerUtility.php.

◆ renderArray()

static string TYPO3\CMS\Extbase\Utility\DebuggerUtility::renderArray (   $array,
  $level,
  $plainText = false,
  $ansiColors = false 
)
staticprotected

Renders a dump of the given array

Parameters
array | \Traversable$array
int$level
bool$plainText
bool$ansiColors
Returns
‪string

Definition at line 120 of file DebuggerUtility.php.

References TYPO3\CMS\Extbase\Utility\DebuggerUtility\ansiEscapeWrap(), and TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderCollection().

Referenced by TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderDump().

◆ renderClosure()

static string TYPO3\CMS\Extbase\Utility\DebuggerUtility::renderClosure (   $object,
  $level,
  $plainText = false,
  $ansiColors = false 
)
staticprotected

Renders a dump of the given closure

Parameters
\Closure$object
int$level
bool$plainText
bool$ansiColors
Returns
‪string

Definition at line 189 of file DebuggerUtility.php.

References TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderContent(), and TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderHeader().

Referenced by TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderDump().

◆ renderCollection()

static string TYPO3\CMS\Extbase\Utility\DebuggerUtility::renderCollection (   $collection,
  $level,
  $plainText,
  $ansiColors 
)
staticprotected
Parameters
mixed$collection
int$level
bool$plainText
bool$ansiColors
Returns
‪string

Definition at line 448 of file DebuggerUtility.php.

Referenced by TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderArray().

◆ renderContent()

static string TYPO3\CMS\Extbase\Utility\DebuggerUtility::renderContent (   $object,
  $level,
  $plainText,
  $ansiColors 
)
staticprotected
Parameters
object$object
int$level
bool$plainText
bool$ansiColors
Returns
‪string The rendered body content of the Object(Storage)

Definition at line 328 of file DebuggerUtility.php.

Referenced by TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderClosure(), and TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderObject().

◆ renderDump()

static string TYPO3\CMS\Extbase\Utility\DebuggerUtility::renderDump (   $value,
  $level,
  $plainText,
  $ansiColors 
)
staticprotected

Renders a dump of the given value

Parameters
mixed$value
int$level
bool$plainText
bool$ansiColors
Returns
‪string

Definition at line 81 of file DebuggerUtility.php.

References TYPO3\CMS\Extbase\Utility\DebuggerUtility\ansiEscapeWrap(), TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderArray(), TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderClosure(), and TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderObject().

◆ renderHeader()

static string TYPO3\CMS\Extbase\Utility\DebuggerUtility::renderHeader (   $object,
  $level,
  $plainText,
  $ansiColors 
)
staticprotected

Renders the header of a given object/collection. It is usually the class name along with some flags.

Parameters
object$object
int$level
bool$plainText
bool$ansiColors
Returns
‪string The rendered header with tags

Definition at line 240 of file DebuggerUtility.php.

References TYPO3\CMS\Extbase\Utility\DebuggerUtility\ansiEscapeWrap(), and debug().

Referenced by TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderClosure(), and TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderObject().

◆ renderObject()

static string TYPO3\CMS\Extbase\Utility\DebuggerUtility::renderObject (   $object,
  $level,
  $plainText = false,
  $ansiColors = false 
)
staticprotected

Renders a dump of the given object

Parameters
object$object
int$level
bool$plainText
bool$ansiColors
Returns
‪string

Definition at line 160 of file DebuggerUtility.php.

References TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderContent(), and TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderHeader().

Referenced by TYPO3\CMS\Extbase\Utility\DebuggerUtility\renderDump().

◆ var_dump()

static string TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump (   $variable,
  $title = null,
  $maxDepth = 8,
  $plainText = false,
  $ansiColors = true,
  $return = false,
  $blacklistedClassNames = null,
  $blacklistedPropertyNames = null 
)
static

A var_dump function optimized for Extbase's object structures

Parameters
mixed$variable‪The value to dump
string$title‪optional custom title for the debug output
int$maxDepth‪Sets the max recursion depth of the dump. De- or increase the number according to your needs and memory limit.
bool$plainText‪If TRUE, the dump is in plain text, if FALSE the debug output is in HTML format.
bool$ansiColors‪If TRUE (default), ANSI color codes is added to the output, if FALSE the debug output not colored.
bool$return‪if TRUE, the dump is returned for custom post-processing (e.g. embed in custom HTML). If FALSE (default), the dump is directly displayed.
array$blacklistedClassNames‪An array of class names (RegEx) to be filtered. Default is an array of some common class names.
array$blacklistedPropertyNames‪An array of property names and/or array keys (RegEx) to be filtered. Default is an array of some common property names.
Returns
‪string if $return is TRUE, the dump is returned. By default, the dump is directly displayed, and nothing is returned.

Definition at line 496 of file DebuggerUtility.php.

Referenced by TYPO3\CMS\Extbase\Tests\Unit\Utility\DebuggerUtilityTest\debuggerDoesNotRewindInstancesOfGenerator(), TYPO3\CMS\Extbase\Tests\Unit\Utility\DebuggerUtilityTest\debuggerRewindsInstancesOfIterator(), TYPO3\CMS\Core\Utility\DebugUtility\renderDump(), TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper\renderStatic(), TYPO3\CMS\Extbase\Tests\Unit\Utility\DebuggerUtilityTest\varDumpHandlesVariadicArguments(), TYPO3\CMS\Extbase\Tests\Unit\Utility\DebuggerUtilityTest\varDumpRespectsBlacklistedClasses(), TYPO3\CMS\Extbase\Tests\Unit\Utility\DebuggerUtilityTest\varDumpRespectsBlacklistedProperties(), TYPO3\CMS\Extbase\Tests\Unit\Utility\DebuggerUtilityTest\varDumpShowsDumpOfDateTime(), TYPO3\CMS\Extbase\Tests\Unit\Utility\DebuggerUtilityTest\varDumpShowsDumpOfDateTimeImmutable(), and TYPO3\CMS\Extbase\Tests\Unit\Utility\DebuggerUtilityTest\varDumpShowsPropertiesOfStdClassObjects().

Member Data Documentation

◆ $blacklistedClassNames

array TYPO3\CMS\Extbase\Utility\DebuggerUtility::$blacklistedClassNames
staticprotected
Initial value:
= array(
'PHPUnit_Framework_MockObject_InvocationMocker',
\‪TYPO3\CMS\‪Extbase\Reflection\ReflectionService::class,
\‪TYPO3\CMS\‪Extbase\Object\ObjectManager::class,
\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\DataMapper::class,
\‪TYPO3\CMS\‪Extbase\Persistence\Generic\PersistenceManager::class,
\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Qom\QueryObjectModelFactory::class,
\‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class
)

Hardcoded list of Extbase class names (regex) which should not be displayed during debugging

Definition at line 36 of file DebuggerUtility.php.

◆ $blacklistedPropertyNames

array TYPO3\CMS\Extbase\Utility\DebuggerUtility::$blacklistedPropertyNames = array( 'warning' )
staticprotected

Hardcoded list of property names (regex) which should not be displayed during debugging

Definition at line 50 of file DebuggerUtility.php.

◆ $maxDepth

int TYPO3\CMS\Extbase\Utility\DebuggerUtility::$maxDepth = 8
staticprotected

Defines the max recursion depth of the dump, set to 8 due to common memory limits

Definition at line 62 of file DebuggerUtility.php.

◆ $renderedObjects

TYPO3 CMS Extbase Persistence ObjectStorage TYPO3\CMS\Extbase\Utility\DebuggerUtility::$renderedObjects
staticprotected

Definition at line 30 of file DebuggerUtility.php.

◆ $stylesheetEchoed

bool TYPO3\CMS\Extbase\Utility\DebuggerUtility::$stylesheetEchoed = false
staticprotected

Is set to TRUE once the CSS file is included in the current page to prevent double inclusions of the CSS file.

Definition at line 56 of file DebuggerUtility.php.

◆ HTML_INDENT

const TYPO3\CMS\Extbase\Utility\DebuggerUtility::HTML_INDENT = '   '

Definition at line 26 of file DebuggerUtility.php.

◆ PLAINTEXT_INDENT

const TYPO3\CMS\Extbase\Utility\DebuggerUtility::PLAINTEXT_INDENT = ' '

Definition at line 25 of file DebuggerUtility.php.

‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3