Question

I'm currently evaluating Flow3 for an upcoming project. The AOP Pattern and Dependency Injection would be just ideal for our purpose.

Now what I can't figure out is how to debug some results in a controller Action.

public function testAction() {
    $beans = $this->coffeeBeanRepository->findAll();
    var_dump($beans); // doesn't work, browser crashes
}

What I've tried:

  • Debugging with PHPStorm and XDEBUG (this is how I do it usually)
  • var_dump / print_r / print
Was it helpful?

Solution

You want to use FLOW3's var_dump, which deals with some of the recursion that comes from deeply nested objects and causes your browser to cache:

\TYPO3\FLOW3\var_dump()

XDebug can be tricky in FLOW3 because FLOW3 creates proxy classes for your classes in order to make all the AOP magic happen. Still, I know the developers here are using xdebug_break() successfully in PHPStorm on their FLOW3 projects, so it's definitely doable.

OTHER TIPS

Xdebug is not so tricky, your cached PHP files must be used to debug purpose, if you need to debug MyController, search for a MyController_Original in the cache directory and put your break point in this file.

You can also use debugproxy.php to improve the usage of xDebug with Flow: https://github.com/sandstorm/debugproxy

In the newest version of Typo3 Flow you have to use:

\TYPO3\Flow\var_dump('test');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top