示例#1
0
文件: Manager.php 项目: vgrish/dvelum
 /**
  * reset all caches
  * @return boolean
  */
 public static function resetAll()
 {
     $cacheManager = new Cache_Manager();
     $list = $cacheManager->getRegistered();
     foreach ($list as $name => $cache) {
         if ($cache) {
             $cache->clean();
         }
     }
     return true;
 }
示例#2
0
 /**
  * Initialize Cache connections
  */
 protected function _initCache()
 {
     if (!$this->_config->get('use_cache')) {
         return;
     }
     $cacheConfig = (include $this->_config->get('configs') . 'cache.php');
     $cacheManager = new Cache_Manager();
     foreach ($cacheConfig as $name => $cfg) {
         if ($cfg['enabled']) {
             $cacheManager->connect($name, $cfg);
         }
     }
     if ($this->_config->get('development')) {
         Debug::setCacheCores($cacheManager->getRegistered());
     }
     $this->_cache = $cacheManager->get('data');
 }