[TYPO3-mvc] extending news

Claus Due claus at wildside.dk
Tue Nov 15 21:12:30 CET 2011


> 
> Am 15.11.2011 20:28, schrieb Xavier Perseguers:
>> I just see one "problem" here... we cannot put a dependency on PHP 5.4
>> before about 2 years after the official release of PHP 5.4.0 (just
>> reusing the info from the move from PHP 5.2 to PHP 5.3 with TYPO3 4.6).
> 
> +1, don't know if it will be 2 years but long time away.

PHP 5.4 will be production ready quite soon, at which time I expect web hosts to offer it as an option.

Since this really doesn't affect Extbase at all (apart from it lacking Traits for the included Domain objects) we could easily clone our current Model objects into Traits and use those Traits other extensions. Extensions other than Extbase could then, if they depend on Traits, mark PHP 5.4 as requirement. Traits should be placed in individual files which will only be touched if requested by another extension implementing the Traits.

All Model objects which would use these Traits would still extend the base class, making sure they are recognized and treated correctly by the Persistence in Extbase. Since Reflection (also) builds directly on native PHP features, it too would recognize the Traits and treat the objects as usual. Annotations and everything. It should be fully compatible out of the box.

So we can have our cake and eat it too - with almost no work. All it takes is some dual maintenance of Model object classes until PHP 5.4 becomes a TYPO3 requirement.

I will experiment with this soon. Sometime after new year when I'm not extremely busy :)


Cheers,
Claus


More information about the TYPO3-project-typo3v4mvc mailing list