[TYPO3-commerce] Hook inspector

Franz Koch typo.removeformessage at fx-graefix.de
Thu Sep 27 10:20:35 CEST 2007


Hi Michiel,

> Have you been wandering when the hooks in the commerce code are actually 
> called and how often?
> 
> I have written a hook inspector which hooks into all the commerce hooks 
> and then outputs a debug('hook called') when the hook is called.
> 
> I have just uploaded the initial release to the repo.
> 
> It should show up pretty soon, the key is: nc_commerce_hookinspector
> 
> I will try to follow the hook specs in the svn head version of commerce.
> 
> It gives some interesting results. On a page with a listing of only two 
> articles the hook: article postinit is called 6 (six) times instead of 
> an expected 2 (two) times.

And I can tell you why. Commerce also instantiates the basket on every 
call, and the basket might contain basket_items which themselfs 
instantiate the article they stand for inside of them. So you might have 
more calls then expected. It also took a while for me to understand 
that, when I tried to speed up commerce a bit.

--
Kind regards,
Franz Koch


More information about the TYPO3-project-commerce mailing list