[TYPO3-dev] Hooks and protected class members

Xavier Perseguers typo3 at perseguers.ch
Thu Sep 23 15:31:06 CEST 2010


Hi,

> I can't see the harm here. There is already an XCLASS mechanism which
> enables extensions to change and access everything that is not private.
> Hooks are better because their subscribers are more likely to survive
> several versions and multiple subscribers can use the same hook.
>
> At the moment the mechanism is whitelisting (sending an array with
> variables to the subscriber). Because the list might become large it is
> understandable that there are not many members in that list. We could
> create a mechanism for blacklisting certain members with the __get /
> __set methods.

Well, at least in some of my extensions, I'm passing _copies_ of my 
variables to the hook. This way they may do whatever they want, chain of 
hooks may receive the value of the previous hook but still, it's up to 
my extension code to decide after that round whether I want to override 
the actual member with the possibly modified value or not.

>> This means they never were intended to be used from outside. Hooks have
>> been given, at least at the beginning, the list of parameters that may
>> be useful within it. If some property is missing, you should either ask
>> to provide such information or we should find out whether a getter would
>> be worth.
>
> Well, since adding properties would be a feature it requires a new major
> release before it is available (and three major releases before it is
> generally available). With the LTS version coming in January that would
> mean that new properties won't be generally available until 2014.

We are not yet at beta stage, meaning it can find its way into LTS and 
start being available in 2011. I'm confident many websites that were not 
updated for a while will use the LTS...

Xavier




More information about the TYPO3-dev mailing list