« April 2012»
M T W T F S S
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            

[blog...]

05.04.2012
09:49

extbase extensions need comments to work - PHP optimizer must not remove it!

If you develop extbase/fluid extension for TYPO3 you will get in contact with PHPdoc blocks before classes, functions, variables. This is no nice to have feature but required for extbase to e.g. recognize the right data type.

I really have to learn this because I am not used to write PHPdoc blocks. Usually, I only copy an existing block and adjust the description which I find very important.

 

PHP optimizer or accelerators cache the compiled PHP bytecode and/or do other optimizations. Unfortunately some remove the PHPdoc blocks from the source code first. This is the default behaviour of eAccelerator.

 

With eAccelerator and extbase you get this exception thrown:

 

 

#1242292003: could not determine type of argument "section" 
of the render-method in ViewHelper "Tx_Fluid_ViewHelpers_RenderViewHelper".
Either the methods docComment is invalid or some PHP optimizer strips off comments.

 

 

What to do?

  1. compile eAccelerator with option "--with-eaccelerator-doc-comment-inclusion": "If you want eAccelerator to retain doc-comments in internal php structures" (eAccelerator help)
  2. use another PHP optimizer. I use xCache on Debian Squeeze which seems to work fine.

Links:

Alexander Bigga
Tags: typo3, extbase
Views: 1501
  •  
  • 0 Comment(s)
  •  

Your comment

Notify me when someone adds another comment to this post

back

[ 26.02.2013 ]