Hi cmple,

That didn't work initially, threw this message
PHP Fatal error:  Uncaught exception 'ReflectionException' with message
'Class Zend\\Cache\\Storage\\Adapter does not exist'
changed the adapter to abstractadapter and it worked. But could you tell me
how to configure the Filesystem cache adapter, ie, I want to change the
cacheDir.


Thanks
Bill


On 12 May 2012 18:45, cmple <[email protected]> wrote:

> 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]
>
>
>

Reply via email to