Beispiel #1
0
 /**
  * Load cache metadata from storage
  *
  * @return void
  */
 protected function _loadMetadata()
 {
     if ($this->_metaData === null) {
         $cacheMetadata = $this->_adapter->load($this->getRequestCacheId() . self::METADATA_CACHE_SUFFIX);
         if ($cacheMetadata) {
             $cacheMetadata = unserialize($cacheMetadata);
         }
         $this->_metaData = empty($cacheMetadata) || !is_array($cacheMetadata) ? array() : $cacheMetadata;
     }
 }
Beispiel #2
0
 /**
  * Retrive cache instance
  *
  * @return Mage_Core_Model_Cache
  */
 public static function getCacheInstance()
 {
     if (is_null(self::$_cache)) {
         $options = Mage::app()->getConfig()->getNode('global/smile_magecache/backend_options');
         if ($options) {
             $options = $options->asArray();
             if (!empty($options['cache_dir'])) {
                 $options['cache_dir'] = Mage::getBaseDir('var') . DS . $options['cache_dir'];
                 Mage::app()->getConfig()->getOptions()->createDirIfNotExists($options['cache_dir']);
             }
             self::$_cache = Mage::getModel('core/cache', $options);
         } else {
             self::$_cache = Mage::app()->getCacheInstance();
         }
     }
     return self::$_cache;
 }