-- holografix . <[email protected]> wrote
(on Monday, 22 March 2010, 08:21 PM +0000):
> I have an _initCachemanager() method in bootstrap
> 
> protected function _initCachemanager()
> {
>         $cacheManager = new Zend_Cache_Manager();
> 
>         $cache = array(
>             'frontend' => array(
>                 'name' => 'Core',
>                 'options' => array(
>                     'lifetime' => 7200,
>                     'automatic_serialization' => true
>                 )
>             ),
>             'backend' => array(
>                 'name' => 'Core',
>                 'options' => array(
>                     'cache_dir' => APPLICATION_PATH . '/data/cache'
>                 )
>             )
>         );
> 
>         $cacheManager->setCacheTemplate('cache', $cache);
> 
>         return $cacheManager;
> }
> 
> After this method I have an _initTranslator() method to setup Zend_Translate.
> How can I get the cache from the previous method to set a cache to the
> translator.

Use dependency tracking.

    protected function _initTranslator()
    {
        $this->bootstrap('cachemanager');
        $manager = $this->getResource('cachemanager');

        // ...
    }

-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

Reply via email to