web/lib/Zend/Application/Resource/Cachemanager.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Application
    16  * @package    Zend_Application
    17  * @subpackage Resource
    17  * @subpackage Resource
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: Cachemanager.php 20785 2010-01-31 09:43:03Z mikaelkael $
    20  * @version    $Id: Cachemanager.php 24593 2012-01-05 20:35:02Z matthew $
    21  */
    21  */
    22 
    22 
    23 require_once 'Zend/Application/Resource/ResourceAbstract.php';
    23 require_once 'Zend/Application/Resource/ResourceAbstract.php';
    24 
    24 
    25 /**
    25 /**
    26  * Cache Manager resource
    26  * Cache Manager resource
    27  *
    27  *
    28  * @category   Zend
    28  * @category   Zend
    29  * @package    Zend_Application
    29  * @package    Zend_Application
    30  * @subpackage Resource
    30  * @subpackage Resource
    31  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    31  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    33  */
    33  */
    34 class Zend_Application_Resource_Cachemanager extends Zend_Application_Resource_ResourceAbstract
    34 class Zend_Application_Resource_Cachemanager extends Zend_Application_Resource_ResourceAbstract
    35 {
    35 {
    36     /**
    36     /**
    55      */
    55      */
    56     public function getCacheManager()
    56     public function getCacheManager()
    57     {
    57     {
    58         if (null === $this->_manager) {
    58         if (null === $this->_manager) {
    59             $this->_manager = new Zend_Cache_Manager;
    59             $this->_manager = new Zend_Cache_Manager;
    60             
    60 
    61             $options = $this->getOptions();
    61             $options = $this->getOptions();
    62             foreach ($options as $key => $value) {
    62             foreach ($options as $key => $value) {
    63                 if ($this->_manager->hasCacheTemplate($key)) {
    63                 if ($this->_manager->hasCacheTemplate($key)) {
    64                     $this->_manager->setTemplateOptions($key, $value);
    64                     $this->_manager->setTemplateOptions($key, $value);
    65                 } else {
    65                 } else {
    66                     $this->_manager->setCacheTemplate($key, $value);
    66                     $this->_manager->setCacheTemplate($key, $value);
    67                 }
    67                 }
    68             }
    68             }
    69         }
    69         }
    70         
    70 
    71         return $this->_manager;
    71         return $this->_manager;
    72     }
    72     }
    73 }
    73 }