Debug Helper Extension for Extbase
By Steffen Müller. Licensed under the Creative Commons License
Extbase in TYPO3 4.5 LTS has no built-in possibility to debug model objects. Whenever you try to var_dump() a model object or log it to t3lib_div::devLog(), you'll probably end up in out-of-memory exceptions. This article introduces an extension as a temporary solution for that.
What's wrong with var_dump()?
Because of circular dependencies in Extbase, dumps made with var_dump() will contain hugh amounts of useless object data of various framework classes. Your memory will probaly be exhausted and an exception is thrown. And you probably do not expect that with 1 GB of RAM reserved for PHP, do you?
A solution was backported from FLOW3 by Felix Oertel but it is still pending in the bugtracker. So we probably won't see it in TYPO3 core until 4.6. To fill the gap between now and then, I merged the code into an extension and provide it for download.
Extension Download
The extension ext_debug can be downloaded. It is in early alpha state and not yet finished. This is why it is not yet available in forge or TER. Be patient.
Extension Usage
e.g. in BlogController.php
[...]
public function indexAction() {
$blogs = $this->blogRepository->findAll();
foreach ($blogs as $blog) {
Tx_ExtDebug::var_dump($blog);
}
}
[...]
Result
Oops, an error occured!
Yes, I am aware of that. The debugger still needs some work. If you want to contribute, please do so and use the Extbase bugtracker on forge.
License
This article is licensed under the Creative Commons License CC BY-SA 3.0. You are free to share (copy, distribute and transmit) and to remix (to adapt) the work under the following conditions:
- You must attribute the work by mentioning the name of the author (Steffen Müller) and setting a link back to the original article using its URL.
- If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

Does not work for PHP 5.2...
What exactly does mot work? Do you get any PHP errors in your logs?
ATM I have no PHP 5.2 system at hand.
Fatal error: Call to undefined method Tx_Extbase_Reflection_PropertyReflection::setAccessible() in /home/[...]/public_html/typo3conf/ext/ext_debug/Classes/Error/Debugger.php on line 155
Hi,
I get the very same error as Gernot.
Does anybody have a solution for this problem?
Many thanks in advance
Andreas
Okay, this (http://php.net/manual/de/reflectionproperty.setaccessible.php) only works for PHP >= 5.3 :-(
Hopefully someone finds a workaround?
I am sorry, I have no time to support legacy for PHP 5.2. Anyway, TYPO3 4.6 will be released in a few days and it depends on PHP 5.3.