[TYPO3-core] RFC #15937: Bug: [Caching framework] Improve error message if no frontend was defined for core caches
Christian Kuhn
lolli at schwarzbu.ch
Fri Oct 8 23:02:50 CEST 2010
Hey,
Ernesto Baschny [cron IT] wrote:
> I suspect your #15940 issue for tt_news is not really valid.
> tx_ttnews_cache::initCachingFramework() does the following:
>
> $GLOBALS['typo3CacheFactory']->create(
> 'tt_news_cache',
> 't3lib_cache_frontend_StringFrontend',
> $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tt_news_cache']['backend'],
>
> $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tt_news_cache']['options']
> );
>
> So the StringFrontend is hardcoded, for probably the same reasons as we
> had cache_pages etc also hardcoded in the core before: The extension
> author has to decide which frontend is required for his specific
> application, because he knows which kind of data he wants to store in
> it. It (still) makes no sense to have that configurable (in my opinion).
Ah, I see, didn't dig into the code so far. Thanks for pointing that out.
> So I guess your exception in the factory is still ok and +1 by reading,
> but it doesn't probably affect the tt_news extension, as you mentioned it.
Yes. But: The garbage collection task fails if there is no full
configuration in typo3_conf_vars. Imho it's still a valid point to have
the full definition at one central place, without hidden / hardcoded
options somewhere. There could be other use case where it's needed to
iterate and instantiate over all configured caches. And in this special
tt_news case: If we have a fallback to VariableFrontend, the factory
would choose the wrong frontend for tt_news (StringFrontend is needed here).
Now I'm confused and don't really know what's the best option: Add
VariableFrontend as fallback in the factory, together with a
deprecationLog() stating that this is not good and should be fixed? Or
just throw and exception without fallback as currently done with the patch?
Regards
Christian
More information about the TYPO3-team-core
mailing list