[TYPO3-dev] Hooks and protected class members

Jigal van Hemert jigal at xs4all.nl
Thu Sep 23 15:07:29 CEST 2010


Hi,

On 23-9-2010 13:28, Xavier Perseguers wrote:
>>> Generally I don't think that a hook subscriber should have access to
>>> all protected members by default.
> Me neither.

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.

> 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.

-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh




More information about the TYPO3-dev mailing list