TYPO3 CMS  TYPO3_6-2
DebuggerUtility.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script belongs to the Extbase framework *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License as published by the *
9  * Free Software Foundation, either version 3 of the License, or (at your *
10  * option) any later version. *
11  * *
12  * This script is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
14  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
15  * General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU Lesser General Public *
18  * License along with the script. *
19  * If not, see http://www.gnu.org/licenses/lgpl.html *
20  * *
21  * The TYPO3 project - inspiring people to share! *
22  * */
34 
35  const PLAINTEXT_INDENT = ' ';
36  const HTML_INDENT = '&nbsp;&nbsp;&nbsp;';
37 
41  static protected $renderedObjects;
42 
48  static protected $blacklistedClassNames = array(
49  'PHPUnit_Framework_MockObject_InvocationMocker',
50  'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\IdentityMap',
51  'TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService',
52  'TYPO3\\CMS\\Extbase\\Object\\ObjectManager',
53  'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper',
54  'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager',
55  'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\QueryObjectModelFactory',
56  'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'
57  );
58 
64  static protected $blacklistedPropertyNames = array('warning');
65 
71  static protected $stylesheetEchoed = FALSE;
72 
78  static protected $maxDepth = 8;
79 
85  static protected function clearState() {
86  self::$renderedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
87  }
88 
98  static protected function renderDump($value, $level, $plainText, $ansiColors) {
99  $dump = '';
100  if (is_string($value)) {
101  $croppedValue = strlen($value) > 2000 ? substr($value, 0, 2000) . '...' : $value;
102  if ($plainText) {
103  $dump = self::ansiEscapeWrap(('"' . implode((PHP_EOL . str_repeat(self::PLAINTEXT_INDENT, ($level + 1))), str_split($croppedValue, 76)) . '"'), '33', $ansiColors) . ' (' . strlen($value) . ' chars)';
104  } else {
105  $dump = sprintf('\'<span class="debug-string">%s</span>\' (%s chars)', implode('<br />' . str_repeat(self::HTML_INDENT, ($level + 1)), str_split(htmlspecialchars($croppedValue), 76)), strlen($value));
106  }
107  } elseif (is_numeric($value)) {
108  $dump = sprintf('%s (%s)', self::ansiEscapeWrap($value, '35', $ansiColors), gettype($value));
109  } elseif (is_bool($value)) {
110  $dump = $value ? self::ansiEscapeWrap('TRUE', '32', $ansiColors) : self::ansiEscapeWrap('FALSE', '32', $ansiColors);
111  } elseif (is_null($value) || is_resource($value)) {
112  $dump = gettype($value);
113  } elseif (is_array($value)) {
114  $dump = self::renderArray($value, $level + 1, $plainText, $ansiColors);
115  } elseif (is_object($value)) {
116  $dump = self::renderObject($value, $level + 1, $plainText, $ansiColors);
117  }
118  return $dump;
119  }
120 
130  static protected function renderArray($array, $level, $plainText = FALSE, $ansiColors = FALSE) {
131  $content = '';
132  $count = count($array);
133 
134  if ($plainText) {
135  $header = self::ansiEscapeWrap('array', '36', $ansiColors);
136  } else {
137  $header = '<span class="debug-type">array</span>';
138  }
139  $header .= $count > 0 ? '(' . $count . ' item' . ($count > 1 ? 's' : '') . ')' : '(empty)';
140  if ($level >= self::$maxDepth) {
141  if ($plainText) {
142  $header .= ' ' . self::ansiEscapeWrap('max depth', '47;30', $ansiColors);
143  } else {
144  $header .= '<span class="debug-filtered">max depth</span>';
145  }
146  } else {
147  $content = self::renderCollection($array, $level, $plainText, $ansiColors);
148  if (!$plainText) {
149  $header = ($level > 1 && $count > 0 ? '<input type="checkbox" /><span class="debug-header" >' : '<span>') . $header . '</span >';
150  }
151  }
152  if ($level > 1 && $count > 0 && !$plainText) {
153  $dump = '<span class="debug-tree">' . $header . '<span class="debug-content">' . $content . '</span></span>';
154  } else {
155  $dump = $header . $content;
156  }
157  return $dump;
158  }
159 
169  static protected function renderObject($object, $level, $plainText = FALSE, $ansiColors = FALSE) {
170  if ($object instanceof \TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy) {
171  $object = $object->_loadRealInstance();
172  if (!$object) {
173  return gettype($object);
174  }
175  }
176  $header = self::renderHeader($object, $level, $plainText, $ansiColors);
177  if ($level < self::$maxDepth && !self::isBlacklisted($object) && !(self::isAlreadyRendered($object) && $plainText !== TRUE)) {
178  $content = self::renderContent($object, $level, $plainText, $ansiColors);
179  } else {
180  $content = '';
181  }
182  if ($plainText) {
183  return $header . $content;
184  } else {
185  return '<span class="debug-tree">' . $header . '<span class="debug-content">' . $content . '</span></span>';
186  }
187  }
188 
195  static protected function isBlacklisted($value) {
196  $result = FALSE;
197  if ($value instanceof \ReflectionProperty) {
198  $result = (strpos(implode('|', self::$blacklistedPropertyNames), $value->getName()) > 0);
199  } elseif (is_object($value)) {
200  $result = (strpos(implode('|', self::$blacklistedClassNames), get_class($value)) > 0);
201  }
202  return $result;
203  }
204 
211  static protected function isAlreadyRendered($object) {
212  return self::$renderedObjects->contains($object);
213  }
214 
224  static protected function renderHeader($object, $level, $plainText, $ansiColors) {
225  $dump = '';
226  $persistenceType = '';
227  $className = get_class($object);
228  $classReflection = new \ReflectionClass($className);
229  if ($plainText) {
230  $dump .= self::ansiEscapeWrap($className, '36', $ansiColors);
231  } else {
232  $dump .= '<span class="debug-type">' . $className . '</span>';
233  }
234  if (!$object instanceof \Closure) {
235  if ($object instanceof \TYPO3\CMS\Core\SingletonInterface) {
236  $scope = 'singleton';
237  } else {
238  $scope = 'prototype';
239  }
240  if ($plainText) {
241  $dump .= ' ' . self::ansiEscapeWrap($scope, '44;37', $ansiColors);
242  } else {
243  $dump .= $scope ? '<span class="debug-scope">' . $scope . '</span>' : '';
244  }
245  if ($object instanceof \TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject) {
246  if ($object->_isDirty()) {
247  $persistenceType = 'modified';
248  } elseif ($object->_isNew()) {
249  $persistenceType = 'transient';
250  } else {
251  $persistenceType = 'persistent';
252  }
253  }
254  if ($object instanceof \TYPO3\CMS\Extbase\Persistence\ObjectStorage && $object->_isDirty()) {
255  $persistenceType = 'modified';
256  }
257  if ($object instanceof \TYPO3\CMS\Extbase\DomainObject\AbstractEntity) {
258  $domainObjectType = 'entity';
259  } elseif ($object instanceof \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject) {
260  $domainObjectType = 'valueobject';
261  } else {
262  $domainObjectType = 'object';
263  }
264  if ($plainText) {
265  $dump .= ' ' . self::ansiEscapeWrap(($persistenceType . ' ' . $domainObjectType), '42;30', $ansiColors);
266  } else {
267  $dump .= '<span class="debug-ptype">' . ($persistenceType ? $persistenceType . ' ' : '') . $domainObjectType . '</span>';
268  }
269  }
270  if (strpos(implode('|', self::$blacklistedClassNames), get_class($object)) > 0) {
271  if ($plainText) {
272  $dump .= ' ' . self::ansiEscapeWrap('filtered', '47;30', $ansiColors);
273  } else {
274  $dump .= '<span class="debug-filtered">filtered</span>';
275  }
276  } elseif (self::$renderedObjects->contains($object) && !$plainText) {
277  $dump = '<a href="javascript:;" onclick="document.location.hash=\'#' . spl_object_hash($object) . '\';" class="debug-seeabove">' . $dump . '<span class="debug-filtered">see above</span></a>';
278  } elseif ($level >= self::$maxDepth && !$object instanceof \DateTime) {
279  if ($plainText) {
280  $dump .= ' ' . self::ansiEscapeWrap('max depth', '47;30', $ansiColors);
281  } else {
282  $dump .= '<span class="debug-filtered">max depth</span>';
283  }
284  } elseif ($level > 1 && !$object instanceof \DateTime && !$plainText) {
285  if (($object instanceof \Countable && count($object) === 0) || (count($classReflection->getProperties()) === 0)) {
286  $dump = '<span>' . $dump . '</span>';
287  } else {
288  $dump = '<input type="checkbox" id="' . spl_object_hash($object) . '" /><span class="debug-header">' . $dump . '</span>';
289  }
290  }
291  if ($object instanceof \Countable) {
292  $dump .= count($object) > 0 ? ' (' . count($object) . ' items)' : ' (empty)';
293  }
294  if ($object instanceof \DateTime) {
295  $dump .= ' (' . $object->format(\DateTime::RFC3339) . ', ' . $object->getTimestamp() . ')';
296  }
297  if ($object instanceof \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface && !$object->_isNew()) {
298  $dump .= ' (uid=' . $object->getUid() . ', pid=' . $object->getPid() . ')';
299  }
300  return $dump;
301  }
302 
310  static protected function renderContent($object, $level, $plainText, $ansiColors) {
311  $dump = '';
312  if ($object instanceof \TYPO3\CMS\Extbase\Persistence\ObjectStorage || $object instanceof \Iterator || $object instanceof \ArrayObject) {
313  $dump .= self::renderCollection($object, $level, $plainText, $ansiColors);
314  } else {
315  self::$renderedObjects->attach($object);
316  if (!$plainText) {
317  $dump .= '<a name="' . spl_object_hash($object) . '" id="' . spl_object_hash($object) . '"></a>';
318  }
319  if (get_class($object) === 'stdClass') {
320  $objReflection = new \ReflectionObject($object);
321  $properties = $objReflection->getProperties();
322  } else {
323  $classReflection = new \ReflectionClass(get_class($object));
324  $properties = $classReflection->getProperties();
325  }
326  foreach ($properties as $property) {
327  if (self::isBlacklisted($property)) {
328  continue;
329  }
330  $dump .= PHP_EOL . str_repeat(self::PLAINTEXT_INDENT, $level);
331  if ($plainText) {
332  $dump .= self::ansiEscapeWrap($property->getName(), '37', $ansiColors);
333  } else {
334  $dump .= '<span class="extbase-debug-property">' .
335  htmlspecialchars($property->getName()) . '</span>';
336  }
337  $dump .= ' => ';
338  $property->setAccessible(TRUE);
339  $dump .= self::renderDump($property->getValue($object), $level, $plainText, $ansiColors);
340  if ($object instanceof \TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject && !$object->_isNew() && $object->_isDirty($property->getName())) {
341  if ($plainText) {
342  $dump .= ' ' . self::ansiEscapeWrap('modified', '43;30', $ansiColors);
343  } else {
344  $dump .= '<span class="debug-dirty">modified</span>';
345  }
346  }
347  }
348  }
349  return $dump;
350  }
351 
359  static protected function renderCollection($collection, $level, $plainText, $ansiColors) {
360  $dump = '';
361  foreach ($collection as $key => $value) {
362  $dump .= PHP_EOL . str_repeat(self::PLAINTEXT_INDENT, $level) . ($plainText ? '' : '<span class="debug-property">') . self::ansiEscapeWrap($key, '37', $ansiColors) . ($plainText ? '' : '</span>') . ' => ';
363  $dump .= self::renderDump($value, $level, $plainText, $ansiColors);
364  }
365  if ($collection instanceof \Iterator) {
366  $collection->rewind();
367  }
368  return $dump;
369  }
370 
379  static protected function ansiEscapeWrap($string, $ansiColors, $enable = TRUE) {
380  if ($enable) {
381  return '[' . $ansiColors . 'm' . $string . '';
382  } else {
383  return $string;
384  }
385  }
386 
401  static public function var_dump($variable, $title = NULL, $maxDepth = 8, $plainText = FALSE, $ansiColors = TRUE, $return = FALSE, $blacklistedClassNames = NULL, $blacklistedPropertyNames = NULL) {
402  self::$maxDepth = $maxDepth;
403  if ($title === NULL) {
404  $title = 'Extbase Variable Dump';
405  }
406  $ansiColors = $plainText && $ansiColors;
407  if ($ansiColors === TRUE) {
408  $title = '' . $title . '';
409  }
410  if (is_array($blacklistedClassNames)) {
411  self::$blacklistedClassNames = $blacklistedClassNames;
412  }
413  if (is_array($blacklistedPropertyNames)) {
414  self::$blacklistedPropertyNames = $blacklistedPropertyNames;
415  }
416  self::clearState();
417  if (!$plainText && self::$stylesheetEchoed === FALSE) {
418  echo '
419  <style type=\'text/css\'>
420  .debug-tree{position:relative;}
421  .debug-tree input{position:absolute;top:0;left:0;cursor:pointer;opacity:0;z-index:2;}
422  .debug-tree input ~ .debug-content{display:none;}
423  .debug-tree .debug-header:before{content:"+";padding:0 2px 0 2px;margin:0 3px 0 3px;font-size:1em;font-weight:bold;color:#004fb0;border:1px #004fb0 solid;}
424  .debug-tree input:checked ~ .debug-content{display:inline;}
425  .debug-tree input:checked ~ .debug-header:before{content:"-";}
426  .Extbase-Utility-Debugger-VarDump{display:block;text-align:left;background:#b9b9b9;border:10px solid #b9b9b9;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;-moz-box-shadow:0 0 20px #333;-webkit-box-shadow:0 0 20px #333;box-shadow:0 0 20px #333;z-index:999;color:#000;margin:20px 0 0;}
427  .Extbase-Utility-Debugger-VarDump-Floating{position:relative;width:96%;margin:40px auto;}
428  .Extbase-Utility-Debugger-VarDump-Top{background:#eee;font:normal bold 12px \'Lucida Grande\',sans-serif;padding:5px;}
429  .Extbase-Utility-Debugger-VarDump-Center{background:#b9b9b9 url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAkCAIAAADD4xdmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7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bL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAACFJREFUeNpi/P//PwMDAwMDAxMDDAx2FsuFR+eGmpsBAwAgmgXHfd6vHgAAAABJRU5ErkJggg==) 0 18px repeat;font:normal normal 11px/18px Monospaced,\'Lucida Console\',monospace;padding:18px 10px;}
430  .Extbase-Utility-Debugger-VarDump-Center pre{background-color:transparent;margin:0;padding:0;}
431  .Extbase-Utility-Debugger-VarDump-Center,.Extbase-Utility-Debugger-VarDump-Center pre,.Extbase-Utility-Debugger-VarDump-Center p,.Extbase-Utility-Debugger-VarDump-Center a,.Extbase-Utility-Debugger-VarDump-Center strong,.Extbase-Utility-Debugger-VarDump-Center .debug-string{font:normal normal 11px/18px Monospaced,\'Lucida Console\',monospace;}
432  .Extbase-Utility-Debugger-VarDump-Center .debug-string{color:#000;white-space:normal;}
433  .Extbase-Utility-Debugger-VarDump-Center .debug-type{color:#004fb0;padding-right:4px;}
434  .Extbase-Utility-Debugger-VarDump-Center .debug-unregistered{background-color:#dce1e8;}
435  .Extbase-Utility-Debugger-VarDump-Center .debug-scope,.Extbase-Utility-Debugger-VarDump-Center .debug-ptype,.Extbase-Utility-Debugger-VarDump-Center .debug-proxy,.Extbase-Utility-Debugger-VarDump-Center .debug-filtered{color:#FFF;font-size:10px;line-height:16px;padding:1px 4px;margin-right:2px;}
436  .Extbase-Utility-Debugger-VarDump-Center .debug-scope{background-color:#3e7fe1;}
437  .Extbase-Utility-Debugger-VarDump-Center .debug-ptype{background-color:#6FBC16;}
438  .Extbase-Utility-Debugger-VarDump-Center .debug-dirty{background-color:#FFFF00;}
439  .Extbase-Utility-Debugger-VarDump-Center .debug-filtered{background-color:#8c8c8c;}
440  .Extbase-Utility-Debugger-VarDump-Center .debug-seeabove{text-decoration:none;font-style:italic;font-weight:400;}
441  .Extbase-Utility-Debugger-VarDump-Center .debug-property{color:#555;line-height:16px;padding:1px 2px;}
442  </style>';
443  self::$stylesheetEchoed = TRUE;
444  }
445  if ($plainText) {
446  $output = $title . PHP_EOL . self::renderDump($variable, 0, TRUE, $ansiColors) . PHP_EOL . PHP_EOL;
447  } else {
448  $output = '
449  <div class="Extbase-Utility-Debugger-VarDump ' . ($return ? 'Extbase-Utility-Debugger-VarDump-Inline' : 'Extbase-Utility-Debugger-VarDump-Floating') . '">
450  <div class="Extbase-Utility-Debugger-VarDump-Top">' . htmlspecialchars($title) . '</div>
451  <div class="Extbase-Utility-Debugger-VarDump-Center">
452  <pre dir="ltr">' . self::renderDump($variable, 0, FALSE, FALSE) . '</pre>
453  </div>
454  </div>
455  ';
456  }
457  if ($return === TRUE) {
458  return $output;
459  } else {
460  echo $output;
461  }
462  return '';
463  }
464 }
static renderHeader($object, $level, $plainText, $ansiColors)
static renderArray($array, $level, $plainText=FALSE, $ansiColors=FALSE)
static renderObject($object, $level, $plainText=FALSE, $ansiColors=FALSE)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.
static renderDump($value, $level, $plainText, $ansiColors)
debug($variable='', $name=' *variable *', $line=' *line *', $file=' *file *', $recursiveDepth=3, $debugLevel=E_DEBUG)