Hey Bill, This should work: http://zend-framework-community.634137.n4.nabble.com/ZF2-Factory-method-and-Zend-Di-td4257197.html#a4557174
boosis wrote > > Hi, > > I am trying to inject Zend Filesystem cache to my service class but > couldn't manage to do it. My DI configuration looks like this > > return array( > 'di' => array( > 'instance' => array( > 'alias' => array( > 'file_cache' => 'Zend\Cache\Storage\Adapter\Filesystem', > 'file_cache_options' => > 'Zend\Cache\Storage\Adapter\FilesystemOptions', > ), > 'file_cache_options' => array( > 'parameters' => array( > 'cacheDir' => '/opt', > 'dirUmask' => '0777' > ), > ), > 'file_cache' => array( > 'parameters' => array( > 'options' => 'file_cache_options' > ), > ), > 'Application\Domain\Service\Deal' => array( > 'parameters' => array( > 'mapper' => 'Application\Domain\Mapper\Deal', > 'cache' => 'file_cache' > ), > ), > > But when I dump the cache object in the Mapper Deal object I get the cache > object with default settings. i.e. I try to set the cacheDir to /opt but > dump still shows /tmp. So I guess FilesystemOptions is not injected > correctly. > > Could someone shed some light on this? > > Thanks > Bill > -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Setting-up-Zend-Filesystem-Cache-with-DI-tp4629194p4629212.html Sent from the Zend Framework mailing list archive at Nabble.com. -- List: [email protected] Info: http://framework.zend.com/archives Unsubscribe: [email protected]
