[TYPO3-ect] Kickstarter MVC Bug: getConfiguration()

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Thu Jun 28 23:12:32 CEST 2007


>> Yes it's only three words that differ. Unfortunatly you can't do this:
> 
> I asked this question in comp.lang.php and they came up with this solution:
> 
> --- quote ---
> Create two different classes (the PHP5 version which extends the PHP4
> version and implements the interfaces) then instantiate the proper one
> using some sort of factory method.  Other than the fact that the PHP5
> version implements your interfaces, the classes will behave in exactly
> the same way.  For example:
> 


Hi Christian,

thank you. I think this is important input. But if we work with 2 different
classnames we get a little problem. Several classes extend tx_lib_object,
i.e tx_lib_controller. You always need to extend tx_lib_controller. You
couldn't use PHP5 features this way.

So the direction is O.K. but it needs a little modification. I think of
this:

tx_lib_objectAncestor extends tx_lib_selfAwareness { ... all is done here ... }

if(t3lib_div::int_from_ver(phpversion())>=5000000) {
    class tx_lib_object extends tx_lib_objectAncestor implements
ArrayAccess, Iterator {  }
} else {
    class tx_lib_object extends tx_lib_objectAncestor {  }
}

Now the classname tx_lib_object keeps always the same. Any shorter solution?

Regards

Elmar


More information about the TYPO3-team-extension-coordination mailing list