[TYPO3-dev] Extension for a new cache backend

Steffen Gebert steffen.gebert at typo3.org
Sat Oct 8 16:40:46 CEST 2011


Hi,

>> Looks like you have one issue with the signature of your constructor. I've
>> attached a patch.
>
> Patch will works on 4.6 install but I'm working on 4.5
> and t3lib_cache_backend_AbstractBackend constructor looks like to have only
> one parameter on this version. This is a important change I think.

Ah, yes, now I remember. As the CF is a back-port from FLOW3, we want to 
stay in sync with them as much as possible. I remember that we had 
discussions, while updating to the latest changes. For FLOW3 it is 
really easy to make API changes, for us, it's usually a no-go.

However, as we expected not so many (=no) alternative caching backends 
in the wild. That's why we did these changes here. But yes, I admit that 
it's pretty bad to now create a backend, which runs with 4.5 and newer 
versions.

> So what is the best way to be compatible for both versions ? Multiple
> constructors (but painfull in php) ? Condition inside ext_localconf ? What
> else ?
Multiple constructors in PHP? How should that work? ;)
I think a condition in ext_localconf.php would be the easiest solution, 
which then registers the backend with a different class name.
I would then suggest to create a wrapper class for 4.5, which has a 
constructor with only one method, which then extends the main class of 
your backend (having the 4.6 compatible constructor).

IIRC that should be possible this way (that a class has a different 
constructor than an ancestor class).

> It will consider informing the person who made the extension rediscache :)
You don't have to tell Christopher, as EXT:rediscache is itself only a 
back-port of the redis backend from 4.5 and thus is somehow obsolete.

Sorry for the hassle..

Kind regards
Steffen

-- 
Steffen Gebert
TYPO3 v4 Core Team Member
TYPO3 Server Administration Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org




More information about the TYPO3-dev mailing list