[TASK] Backported FLOW3 Debugger
authorAlexander Schnitzler <alex.schnitzler@typovision.de>
Thu, 12 Jan 2012 23:19:47 +0000 (00:19 +0100)
committerJochen Rau <jochen.rau@typoplanet.de>
Fri, 3 Feb 2012 01:57:23 +0000 (20:57 -0500)
This is an improved version of the FLOW3 debugger
for enhanced object debugging i.e. debugging also private
properties through reflection. It is invoked by
Tx_Extbase_Utility_Debugger::var_dump($blog). The method
has several configuration options.

Change-Id: I06b626a9bf419fe50e54a0fd750648e6ee8a868e
Resolves: #32734

typo3/sysext/extbase/Classes/Extbase.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Utility/Debugger.php [new file with mode: 0644]
typo3/sysext/extbase/ext_autoload.php

diff --git a/typo3/sysext/extbase/Classes/Extbase.php b/typo3/sysext/extbase/Classes/Extbase.php
new file mode 100644 (file)
index 0000000..ed0c635
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/*                                                                        *
+ * This script belongs to the Extbase framework                           *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ */
+
+/**
+ * A helper class providing some methods in an easier namespace
+ *
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @api
+ */
+class Tx_Extbase {
+
+       /**
+        * calls Tx_Extbase_Error_Debugger::var_dump()
+        * @param mixed $variable The variable to display a dump of
+        * @param string $title optional custom title for the debug output
+        * @param integer $recursionDepth Sets the max recursion depth of the dump. De- or increase the number according to your needs and memory limit.
+        * @param boolean $return if TRUE, the dump is returned for displaying it embedded in custom HTML. If FALSE (default), the variable dump is directly displayed.
+        * @param boolean $plaintext If TRUE, the dump is in plain text, if FALSE the debug output is in HTML format. If not specified, the dump is in HTML format.
+        * @return void/string if $return is TRUE, the variable dump is returned. By default, the dump is directly displayed, and nothing is returned.
+        */
+       static public function var_dump($variable, $title = NULL, $recursionDepth = 15, $return = FALSE, $plaintext = FALSE) {
+               return Tx_Extbase_Error_Debugger::var_dump($variable, $title, $recursionDepth, $return, $plaintext);
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Utility/Debugger.php b/typo3/sysext/extbase/Classes/Utility/Debugger.php
new file mode 100644 (file)
index 0000000..2fb2469
--- /dev/null
@@ -0,0 +1,442 @@
+<?php
+
+/*                                                                        *
+ * This script belongs to the Extbase framework                           *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * This class is a backport of the corresponding class of FLOW3.
+ * All credits go to the v5 team.
+ */
+
+/**
+ * A debugging utility class
+ *
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @api
+ */
+class Tx_Extbase_Utility_Debugger {
+
+       const PLAINTEXT_INDENT = '   ';
+       const HTML_INDENT = '&nbsp;&nbsp;&nbsp;';
+
+       /**
+        * @var Tx_Extbase_Persistence_ObjectStorage
+        */
+       protected static $renderedObjects;
+
+       /**
+        * Hardcoded list of Extbase class names (regex) which should not be displayed during debugging
+        * @var array
+        */
+       protected static $blacklistedClassNames = array(
+               'PHPUnit_Framework_MockObject_InvocationMocker',
+               'Tx_Extbase_Persistence_IdentityMap',
+               'Tx_Extbase_Reflection_Service',
+               'Tx_Extbase_Object_ObjectManager',
+               'Tx_Extbase_Persistence_Mapper_DataMapper',
+               'Tx_Extbase_Persistence_Manager',
+               'Tx_Extbase_Persistence_QOM_QueryObjectModelFactory',
+               'tslib_cObj');
+
+       /**
+        * Hardcoded list of property names (regex) which should not be displayed during debugging
+        * @var array
+        */
+       protected static $blacklistedPropertyNames = array('warning');
+
+       /**
+        * Is set to TRUE once the CSS file is included in the current page to prevent double inclusions of the CSS file.
+        * @var boolean
+        */
+       protected static $stylesheetEchoed = FALSE;
+
+       /**
+        * Defines the max recursion depth of the dump, set to 8 due to common memory limits
+        * @var int
+        */
+       protected static $maxDepth = 8;
+
+       /**
+        * Clear the state of the debugger
+        *
+        * @return void
+        */
+       protected static function clearState() {
+               self::$renderedObjects = new Tx_Extbase_Persistence_ObjectStorage;
+       }
+
+       /**
+        * Renders a dump of the given value
+        *
+        * @param mixed $value
+        * @param integer $level
+        * @param boolean $plainText
+        * @param boolean $ansiColors
+        * @return string
+        */
+       protected static function renderDump($value, $level, $plainText, $ansiColors) {
+               $dump = '';
+               if (is_string($value)) {
+                       $croppedValue = (strlen($value) > 2000) ? substr($value, 0, 2000) . '...' : $value;
+                       if ($plainText) {
+                               $dump = self::ansiEscapeWrap('"' . implode(PHP_EOL . str_repeat(self::PLAINTEXT_INDENT, $level + 1),
+                                       str_split($croppedValue, 76)) . '"', '33', $ansiColors) . ' (' . strlen($value) . ' chars)';
+                       } else {
+                               $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));
+                       }
+               } elseif (is_numeric($value)) {
+                       $dump = sprintf('%s (%s)', self::ansiEscapeWrap($value, '35', $ansiColors), gettype($value));
+               } elseif (is_bool($value)) {
+                       $dump = $value ? self::ansiEscapeWrap('TRUE', '32', $ansiColors) : self::ansiEscapeWrap('FALSE', '32', $ansiColors);
+               } elseif (is_null($value) || is_resource($value)) {
+                       $dump = gettype($value);
+               } elseif (is_array($value)) {
+                       $dump = self::renderArray($value,  $level + 1, $plainText, $ansiColors);
+               } elseif (is_object($value)) {
+                       $dump = self::renderObject($value,  $level + 1, $plainText, $ansiColors);
+               }
+               return $dump;
+       }
+
+       /**
+        * Renders a dump of the given array
+        *
+        * @param array $array
+        * @param integer $level
+        * @param boolean $renderItems
+        * @param boolean $plainText
+        * @param boolean $ansiColors
+        * @return string
+        */
+       protected static function renderArray($array, $level, $plainText = FALSE, $ansiColors = FALSE) {
+               $type = is_array($array) ? 'array' : get_class($array);
+               if ($plainText) {
+                       $header = self::ansiEscapeWrap($type, '36', $ansiColors);
+               } else {
+                       $header = '<span class="debug-type">' . $type . '</span>';
+               }
+
+               $header .= (count($array) > 0 ? ' (' . count($array) .' items)' : ' (empty)');
+
+               if ($level >= self::$maxDepth) {
+                       if ($plainText) {
+                               $content = ' ' . self::ansiEscapeWrap('max depth', '47;30', $ansiColors);
+                       } else {
+                               $content = '<span class="debug-filtered">max depth</span>';
+                       }
+               } else {
+                       $content = self::renderCollection($array, $level, $plainText, $ansiColors);
+               }
+
+               if ($level > 1 && count($array) > 0 && !$plainText) {
+                       $dump = '<span class="debug-tree"><input type="checkbox" /><span class="debug-header">' . $header . '</span><span class="debug-content">' . $content . '</span></span>';
+               } else {
+                       $dump = $header . $content;
+               }
+
+               return $dump;
+       }
+
+       /**
+        * Renders a dump of the given object
+        *
+        * @param object $object
+        * @param integer $level
+        * @param boolean $renderProperties
+        * @param boolean $plainText
+        * @param boolean $ansiColors
+        * @return string
+        */
+       protected static function renderObject($object, $level, $plainText = FALSE, $ansiColors = FALSE) {
+               if ($object instanceof Tx_Extbase_Persistence_LazyLoadingProxy) {
+                       $object = $object->_loadRealInstance();
+               }
+
+               $header = self::renderHeader($object, $level, $plainText, $ansiColors);
+
+               if ($level < self::$maxDepth && !self::isBlacklisted($object) && !(self::isAlreadyRendered($object) && $plainText !== TRUE)) {
+                       $content = self::renderContent($object, $level, $plainText, $ansiColors);
+               } else {
+                       $content = '';
+               }
+
+               if ($plainText) {
+                       return $header . $content;
+               } else {
+                       return '<span class="debug-tree">' . $header . '<span class="debug-content">' . $content . '</span></span>';
+               }
+       }
+
+       /**
+        * Checks if a given object or property should be excluded/filtered
+        *
+        * @param object $value An ReflectionProperty or other Object
+        * @return bool TRUE if the given object should be filtered
+        */
+       protected static function isBlacklisted($value) {
+               $result = FALSE;
+               if ($value instanceof ReflectionProperty) {
+                       $result = (bool) preg_match('/' . implode('|', self::$blacklistedPropertyNames) . '/', $value->getName());
+               } elseif (is_object($value)) {
+                       $result = (bool) preg_match('/' . implode('|', self::$blacklistedClassNames) . '/', get_class($value));
+               }
+               return $result;
+       }
+
+       /**
+        * Checks if a given object was already rendered.
+        *
+        * @param $object
+        * @return bool TRUE if the given object was already rendered
+        */
+       protected static function isAlreadyRendered($object) {
+               return self::$renderedObjects->contains($object);
+       }
+
+       /**
+        * Renders the header of a given object/collection. It is usually the class name along with some flags.
+        *
+        * @param $object
+        * @param $level
+        * @param $plainText
+        * @param $ansiColors
+        * @return string The rendered header with tags
+        */
+       protected static function renderHeader($object, $level, $plainText, $ansiColors) {
+               $dump = '';
+
+               $className = get_class($object);
+               if ($plainText) {
+                       $dump .= self::ansiEscapeWrap($className, '36', $ansiColors);
+               } else {
+                       $dump .= '<span class="debug-type">' . $className . '</span>';
+               }
+
+               if ($object instanceof t3lib_Singleton) {
+                       $scope = 'singleton';
+               } else {
+                       $scope = 'prototype';
+               }
+               if ($plainText) {
+                       $dump .= ' ' . self::ansiEscapeWrap($scope, '44;37', $ansiColors);
+               } else {
+                       $dump .= ($scope ? '<span class="debug-scope">' . $scope . '</span>' : '');
+               }
+
+               if ($object instanceof Tx_Extbase_DomainObject_AbstractDomainObject) {
+                       if ($object->_isDirty()) {
+                               $persistenceType = 'modified';
+                       } elseif ($object->_isNew()) {
+                               $persistenceType = 'transient';
+                       } else {
+                               $persistenceType = 'persistent';
+                       }
+               }
+               if ($object instanceof Tx_Extbase_Persistence_ObjectStorage && $object->_isDirty()) {
+                       $persistenceType = 'modified';
+               }
+               if ($object instanceof Tx_Extbase_DomainObject_AbstractEntity) {
+                       $domainObjectType = 'entity';
+               } elseif ($object instanceof Tx_Extbase_DomainObject_AbstractValueObject) {
+                       $domainObjectType = 'valueobject';
+               } else {
+                       $domainObjectType = 'object';
+               }
+               if ($plainText) {
+                       $dump .= ' ' . self::ansiEscapeWrap($persistenceType . ' ' . $domainObjectType, '42;30', $ansiColors);
+               } else {
+                       $dump .= '<span class="debug-ptype">' . $persistenceType . ' ' . $domainObjectType . '</span>';
+               }
+
+               if (preg_match('/' . implode('|', self::$blacklistedClassNames) . '/', get_class($object)) !== 0) {
+                       if ($plainText) {
+                               $dump .= ' ' . self::ansiEscapeWrap('filtered', '47;30', $ansiColors);
+                       } else {
+                               $dump .= '<span class="debug-filtered">filtered</span>';
+                       }
+               } elseif (self::$renderedObjects->contains($object) && !$plainText) {
+                       $dump = '<a href="javascript:;" onclick="document.location.hash=\'#' . spl_object_hash($object)
+                               . '\';" class="debug-seeabove">' . $dump . '<span class="debug-filtered">see above</span></a>';
+               } elseif ($level >= self::$maxDepth && !($object instanceof DateTime)) {
+                       if ($plainText) {
+                               $dump .= ' ' . self::ansiEscapeWrap('max depth', '47;30', $ansiColors);
+                       } else {
+                               $dump .= '<span class="debug-filtered">max depth</span>';
+                       }
+               } elseif ($level > 1 && !($object instanceof DateTime) && !$plainText) {
+                       $dump = '<input type="checkbox" id="' . spl_object_hash($object) . '" /><span class="debug-header">' . $dump . '</span>';
+               }
+
+               if ($object instanceof Countable) {
+                       $dump .= (count($object) > 0 ? ' (' . count($object) .' items)' : ' (empty)');
+               }
+               if ($object instanceof DateTime) {
+                       $dump .= ' (' . $object->format(DateTime::RFC3339) . ', ' . $object->getTimestamp() . ')';
+               }
+               if ($object instanceof Tx_Extbase_DomainObject_DomainObjectInterface && !$object->_isNew()) {
+                       $dump .= ' (uid=' . $object->getUid() .', pid=' . $object->getPid() . ')';
+               }
+
+               return $dump;
+       }
+
+       /**
+        * @param $object
+        * @param $level
+        * @param $plainText
+        * @param $ansiColors
+        * @return string The rendered body content of the Object(Storage)
+        */
+       protected static function renderContent($object, $level, $plainText, $ansiColors) {
+               $dump = '';
+               if ($object instanceof Tx_Extbase_Persistence_ObjectStorage || $object instanceof Iterator) {
+                       $dump .= self::renderCollection($object, $level, $plainText, $ansiColors);
+               } else {
+                       self::$renderedObjects->attach($object);
+                       if (!$plainText) {
+                               $dump .= '<a name="' . spl_object_hash($object) . '" id="' . spl_object_hash($object) . '"></a>';
+                       }
+                       $classReflection = new ReflectionClass(get_class($object));
+                       $properties = $classReflection->getProperties();
+                       foreach ($properties as $property) {
+                               if (self::isBlacklisted($property)) continue;
+                               $dump .= PHP_EOL . str_repeat(self::PLAINTEXT_INDENT, $level) . ($plainText ? '': '<span class="debug-property">') . self::ansiEscapeWrap($property->getName(), '37', $ansiColors) . ($plainText ? '' : '</span>') . ' => ';
+                               $property->setAccessible(TRUE);
+                               $dump .= self::renderDump($property->getValue($object), $level, $plainText, $ansiColors);
+                               if ($object instanceof Tx_Extbase_DomainObject_AbstractDomainObject && !$object->_isNew() && $object->_isDirty($property->getName())) {
+                                       if ($plainText) {
+                                               $dump .= ' ' . self::ansiEscapeWrap('modified', '43;30', $ansiColors);
+                                       } else {
+                                               $dump .= '<span class="debug-dirty">modified</span>';
+                                       }
+                               }
+                       }
+               }
+               return $dump;
+       }
+
+       protected static function renderCollection($collection, $level, $plainText, $ansiColors) {
+               $dump = '';
+               foreach ($collection as $key => $value) {
+                       $dump .= PHP_EOL . str_repeat(self::PLAINTEXT_INDENT, $level) . ($plainText ? '' : '<span class="debug-property">') . self::ansiEscapeWrap($key, '37', $ansiColors) . ($plainText ? '' : '</span>') . ' => ';
+                       $dump .= self::renderDump($value, $level + 1, $plainText, $ansiColors);
+               }
+               return $dump;
+       }
+
+       /**
+        * Wrap a string with the ANSI escape sequence for colorful output
+        *
+        * @param string $string The string to wrap
+        * @param string $ansiColors The ansi color sequence (e.g. "1;37")
+        * @param boolean $enable If FALSE, the raw string will be returned
+        * @return string The wrapped or raw string
+        */
+       protected static function ansiEscapeWrap($string, $ansiColors, $enable = TRUE) {
+               if ($enable) {
+                       return "\x1B[" . $ansiColors . 'm' . $string . "\x1B[0m";
+               } else {
+                       return $string;
+               }
+       }
+
+       /**
+        * A var_dump function optimized for Extbase's object structures
+        *
+        * @param mixed $variable The value to dump
+        * @param string $title optional custom title for the debug output
+        * @param integer $maxDepth Sets the max recursion depth of the dump. De- or increase the number according to your needs and memory limit.
+        * @param boolean $plainText If TRUE, the dump is in plain text, if FALSE the debug output is in HTML format.
+        * @param boolean $ansiColors If TRUE (default), ANSI color codes is added to the output, if FALSE the debug output not colored.
+        * @param boolean $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.
+        * @param array $blacklistedClassNames An array of class names (RegEx) to be filtered. Default is an array of some common class names.
+        * @param array $blacklistedPropertyNames An array of property names and/or array keys (RegEx) to be filtered. Default is an array of some common property names.
+        * @return void/string if $return is TRUE, the dump is returned. By default, the dump is directly displayed, and nothing is returned.
+        * @api
+        */
+       public static function var_dump($variable, $title = NULL, $maxDepth = 8, $plainText = FALSE, $ansiColors = TRUE, $return = FALSE, $blacklistedClassNames = NULL, $blacklistedPropertyNames = NULL) {
+               self::$maxDepth = $maxDepth;
+
+               if ($title === NULL) {
+                       $title = 'Extbase Variable Dump';
+               }
+               $ansiColors = $plainText && $ansiColors;
+               if ($ansiColors === TRUE) {
+                       $title = "\x1B[1m" . $title . "\x1B[0m";
+               }
+               if (is_array($blacklistedClassNames)) {
+                       self::$blacklistedClassNames = $blacklistedClassNames;
+               }
+               if (is_array($blacklistedPropertyNames)) {
+                       self::$blacklistedPropertyNames = $blacklistedPropertyNames;
+               }
+               self::clearState();
+
+               if (!$plainText && self::$stylesheetEchoed === FALSE) {
+                       echo '
+                               <style type=\'text/css\'>
+                                       .debug-tree{position:relative;}
+                                       .debug-tree input{position:absolute;top:0px;left:0px;cursor:pointer;opacity:0;z-index:2;}
+                                       .debug-tree input ~ .debug-content{display:none;}
+                                       .debug-tree .debug-header:before{content:"+";padding:0px 2px 0px 2px;margin:0 3px 0 3px;font-size:1em;font-weight:bold;color:#004fb0;border:1px #004fb0 solid;}
+                                       .debug-tree input:checked ~ .debug-content{display:inline;}
+                                       .debug-tree input:checked ~ .debug-header:before{content:"-";}
+                                       .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;}
+                                       .Extbase-Utility-Debugger-VarDump-Floating{position:relative;width:96%;margin:40px auto;}
+                                       .Extbase-Utility-Debugger-VarDump-Top{background:#eee;font:normal bold 12px \'Lucida Grande\',sans-serif;padding:5px;}
+                                       .Extbase-Utility-Debugger-VarDump-Center{background:#b9b9b9 url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAkCAIAAADD4xdmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNR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brnjg+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;}
+                                       .Extbase-Utility-Debugger-VarDump-Center pre{background-color:transparent;margin:0;}
+                                       .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;}
+                                       .Extbase-Utility-Debugger-VarDump-Center .debug-string{color:#000;white-space:normal;}
+                                       .Extbase-Utility-Debugger-VarDump-Center .debug-type{color:#004fb0;padding-right:4px;}
+                                       .Extbase-Utility-Debugger-VarDump-Center .debug-unregistered{background-color:#dce1e8;}
+                                       .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;}
+                                       .Extbase-Utility-Debugger-VarDump-Center .debug-scope{background-color:#3e7fe1;}
+                                       .Extbase-Utility-Debugger-VarDump-Center .debug-ptype{background-color:#6FBC16;}
+                                       .Extbase-Utility-Debugger-VarDump-Center .debug-dirty{background-color:#FFFF00;}
+                                       .Extbase-Utility-Debugger-VarDump-Center .debug-filtered{background-color:#8c8c8c;}
+                                       .Extbase-Utility-Debugger-VarDump-Center .debug-seeabove{text-decoration:none;font-style:italic;font-weight:400;}
+                                       .Extbase-Utility-Debugger-VarDump-Center .debug-property{color:#555;line-height:16px;padding:1px 2px;}
+                               </style>';
+                       self::$stylesheetEchoed = TRUE;
+               }
+
+               if ($plainText) {
+                       $output = $title . PHP_EOL . self::renderDump($variable, 0, TRUE, $ansiColors) . PHP_EOL . PHP_EOL;
+               } else {
+                       $output = '
+                               <div class="Extbase-Utility-Debugger-VarDump ' . ($return ? 'Extbase-Utility-Debugger-VarDump-Inline' : 'Extbase-Utility-Debugger-VarDump-Floating') . '">
+                               <div class="Extbase-Utility-Debugger-VarDump-Top">' . htmlspecialchars($title) . '</div>
+                               <div class="Extbase-Utility-Debugger-VarDump-Center">
+                                       <pre dir="ltr">' . self::renderDump($variable, 0, FALSE, FALSE) . '</pre>
+                               </div>
+                       </div>
+                       ';
+               }
+
+               if ($return === TRUE) {
+                       return $output;
+               } else {
+                       echo $output;
+               }
+       }
+}
+?>
\ No newline at end of file
index 389c161..9256680 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-// DO NOT CHANGE THIS FILE! It is automatically generated by extdeveval::buildAutoloadRegistry.
-// This file was generated on 2011-06-30 11:15
 
 $extensionClassesPath = t3lib_extMgm::extPath('extbase') . 'Classes/';
 return array(
@@ -241,6 +239,7 @@ return array(
        'tx_extbase_signalslot_exception_invalidslotexception' => $extensionClassesPath . 'SignalSlot/Exception/InvalidSlotException.php',
        'tx_extbase_utility_arrays' => $extensionClassesPath . 'Utility/Arrays.php',
        'tx_extbase_utility_cache' => $extensionClassesPath . 'Utility/Cache.php',
+       'tx_extbase_utility_debugger' => $extensionClassesPath . 'Utility/Debugger.php',
        'tx_extbase_utility_classloader' => $extensionClassesPath . 'Utility/ClassLoader.php',
        'tx_extbase_utility_extbaserequirementscheck' => $extensionClassesPath . 'Utility/ExtbaseRequirementsCheck.php',
        'tx_extbase_utility_extension' => $extensionClassesPath . 'Utility/Extension.php',