예제 #1
0
 /**
  * Save configuration cache
  *
  * @param	array $tags cache tags
  * @return	Mage_Core_Model_Config
  */
 public function saveCache($tags = array())
 {
     if (!empty($this->_cacheSections)) {
         $xml = clone $this->_xml;
         foreach ($this->_cacheSections as $sectionName => $level) {
             $this->_saveSectionCache($this->getCacheId(), $sectionName, $xml, $level, $tags);
             unset($xml->{$sectionName});
         }
         $xmlStr = $xml->asNiceXml('', false);
         $this->_saveCache($xmlStr, $this->getCacheId(), $tags, $this->getCacheLifetime());
     } else {
         parent::saveCache($tags);
     }
     return $this;
 }
예제 #2
0
 /**
  * Save configuration cache
  *
  * @param   array $tags cache tags
  * @return  Mage_Core_Model_Config
  */
 public function saveCache($tags = array())
 {
     if (!Mage::app()->useCache('config')) {
         return $this;
     }
     if (!in_array(self::CACHE_TAG, $tags)) {
         $tags[] = self::CACHE_TAG;
     }
     $cacheLockId = $this->_getCacheLockId();
     if ($this->_loadCache($cacheLockId)) {
         return $this;
     }
     if (!empty($this->_cacheSections)) {
         $xml = clone $this->_xml;
         foreach ($this->_cacheSections as $sectionName => $level) {
             $this->_saveSectionCache($this->getCacheId(), $sectionName, $xml, $level, $tags);
             unset($xml->{$sectionName});
         }
         $this->_cachePartsForSave[$this->getCacheId()] = $xml->asNiceXml('', false);
     } else {
         return parent::saveCache($tags);
     }
     $this->_saveCache(time(), $cacheLockId, array(), 60);
     $this->removeCache();
     foreach ($this->_cachePartsForSave as $cacheId => $cacheData) {
         $this->_saveCache($cacheData, $cacheId, $tags, $this->getCacheLifetime());
     }
     unset($this->_cachePartsForSave);
     $this->_removeCache($cacheLockId);
     return $this;
 }
예제 #3
0
 public function saveCache($tags = array())
 {
     parent::saveCache($tags);
     return $this;
 }