[TYPO3-50-general] Fluid: Caching and additionalArguments

Robert Lemke robert at typo3.org
Wed Mar 4 08:48:54 CET 2009


Hi Peter and Sebastian,

Am 03.03.2009 um 22:47 schrieb Sebastian Kurfürst:

>> #1229967561: Class "F3\FLOW3\Cache\Backend\BackendInterface" which  
>> was
>> specified in the object configuration of object "F3\FLOW3\Cache
>> \Backend
>> \BackendInterface" does not exist.

> @Karsten/Robert: Can you help with this error message? I'm currently
> not fully sure what is causing this.

"Yeah that's a classic, ..." ;-)

Read the message again: "Class ... BackendInterface ...does not exist".
That's right, there's no such class, only an interface.

The reason for this message is a missing object configuration:

Somewhere you inject a cache frontend. This frontend is injected  
through autowiring because
no other object configuration exists.
The frontend needs a backend (BackendInterface) and expects it to be  
injected as well.
However, the BackendInterface cannot be autowired because no object of  
that name exists
(on purpose, because you have to choose and configure a backend  
cautiously). Therefore
the injection of a backend into the frontend must be configured  
explicitly - or better
be avoided altogether by using the Cache Factory.

Solution: Wherever you inject the cache frontend - that injection must  
be configured
in the Objects.yaml and use the Cache Factory in order to build a  
fully functional
cache which then can be injected.

Example:

-- Objects.yaml ---

F3\FLOW3\AOP\Framework:
   properties:
     proxyClassCodesCache:
       object:
         factoryClassName: F3\FLOW3\Cache\Manager
         factoryMethodName: getCache
         arguments:
           1: value: FLOW3_AOP_ProxyClassCodes

-- Caches.yaml ---

FLOW3_AOP_ProxyClassCodes:
   frontend: F3\FLOW3\Cache\Frontend\StringFrontend

Clear?

Cheers,
robert


More information about the TYPO3-project-5_0-general mailing list