Public Member Functions | Protected Attributes

Robo47_Application_Resource_Cache Class Reference

List of all members.

Public Member Functions

 _setupCache ($config)
 Setup Cache.
 getCache ()
 Get Cache.
 init ()

Protected Attributes

 $_cache = array()

Detailed Description

Definition at line 34 of file Cache.php.


Member Function Documentation

Robo47_Application_Resource_Cache::_setupCache ( config  ) 

Setup Cache.

Parameters:
array $config

Definition at line 60 of file Cache.php.

Referenced by init().

    {
        if (!isset($config['frontendName'])) {
            $message = 'Cache config doesn\'t contain frontendName';
            throw new Robo47_Application_Resource_Exception($message);
        }

        if (!isset($config['backendName'])) {
            $message = 'Cache config doesn\'t contain backendName';
            throw new Robo47_Application_Resource_Exception($message);
        }

        if (!isset($config['frontendOptions'])) {
            $config['frontendOptions'] = array();
        }

        if (!isset($config['backendOptions'])) {
            $config['backendOptions'] = array();
        }

        if (!isset($config['customFrontendNaming'])) {
            $config['customFrontendNaming'] = false;
        }

        if (!isset($config['customBackendNaming'])) {
            $config['customBackendNaming'] = false;
        }

        if (!isset($config['autoload'])) {
            $config['autoload'] = false;
        }

        $cache = Zend_Cache::factory(
            $config['frontendName'],
            $config['backendName'],
            $config['frontendOptions'],
            $config['backendOptions'],
            $config['customFrontendNaming'],
            $config['customBackendNaming'],
            $config['autoload']
        );

        if (isset($config['registryKey'])) {
            Zend_Registry::set($config['registryKey'], $cache);
        }
        return $cache;
    }

Here is the caller graph for this function:

Robo47_Application_Resource_Cache::getCache (  ) 

Get Cache.

Returns:
Zend_Cache

Definition at line 113 of file Cache.php.

    {
        return $this->_cache;
    }

Robo47_Application_Resource_Cache::init (  ) 

Definition at line 44 of file Cache.php.

References _setupCache().

    {
        if (!empty($this->_options)) {
            $this->_cache = $this->_setupCache($this->_options);
        } else {
            $message = 'Empty options in resource ' .
                'Robo47_Application_Resource_Cache.';
            throw new Robo47_Application_Resource_Exception($message);
        }
    }

Here is the call graph for this function:


Member Data Documentation

Robo47_Application_Resource_Cache::$_cache = array() [protected]

Definition at line 42 of file Cache.php.


The documentation for this class was generated from the following file: