[TYPO3-dev] The extbase dilemma

Bastian Waidelich bastian at typo3.org
Thu May 26 13:42:47 CEST 2011


Björn Steinbrink wrote:

Hi Björn,

>> Actually it's just a couple of lines of code if you use Dependency
>> Injection as described in the wiki [1]:

> And uriFor() is too early in the call chain, especially if one plans to
> just wrap it.

That's right, instead you can of course wrap the build() method which is 
the last call of all URI creations in Extbase.


> And since typoLink() isn't purely functional (it accesses global variables), such
> a cache key generator would need at least _some_ of the logic that's
> buried in there to be generally usable.

Correct, that's why I wrote, that it might better be fixed in the v4 
core. But apart from that: If you expect the globals to change during 
one request, you're in trouble with TYPO3 v4 anyways IMO.


> [1] I just had a quick glance over the object container code, and in
> fact, since the object container is a singleton and the registered
> implementation classes aren't cleared (AFAICT)

Yes, as stated in the wiki [1] "[...] this setting can only be 
configured globally right now, it is not possible to override that on a 
per-extension basis."
That's why we use TypoScript for this configuration, so you can be in 
control of this independently from the loading order.


> And I think similarly bad things happen, when you dispatch one extbase
> plugin from within another (using e.g. the cObject view helper, or
> whatever). The "inner" one might reconfigure the object container, so
> the "outer" one suddenly sees different objects.

Overriding the CI configuration would only be possible by calling 
Tx_Extbase_Object_Container_Container::registerImplementation() (which 
is not part of the public API and is only there to change 
implementations already in ext_localconf.php) instead of going the 
supported TypoScript way.

Best,
Bastian

[1] 
<http://forge.typo3.org/projects/typo3v4-mvc/wiki/Dependency_Injection_%28DI%29> 






More information about the TYPO3-dev mailing list