Exemple #1
0
 /**
  * Check - metadata is changed or not
  * 
  * @return boolean
  */
 protected function isMetadataChanged()
 {
     $previous = \Includes\Decorator\Utils\CacheInfo::get('metadata', false);
     if (!$previous) {
         $result = true;
     } else {
         $currentHash = $this->getMetadataHash(\Includes\Decorator\Utils\CacheInfo::get('metadata'));
         $previousHash = $this->getMetadataHash($previous);
         \Includes\Decorator\Utils\CacheInfo::set('metadataHashes', array('current' => $currentHash, 'previous' => $previousHash));
         $result = $currentHash != $previousHash;
     }
     return $result;
 }
Exemple #2
0
 /**
  * Execute certain hook handle
  *
  * @return void
  */
 public function executeHookHandler()
 {
     if (static::isCalculateCacheAllowed() && \Includes\Decorator\Utils\CacheInfo::get('rebuildBlockMark')) {
         $i = static::getCounter();
         do {
             $processed = \XLite\Core\QuickData::getInstance()->updateChunk($i, static::CHUNK_LENGTH);
             if (0 < $processed) {
                 \XLite\Core\Database::getEM()->clear();
             }
             $i += $processed;
             static::setCounter($i);
             \Includes\Utils\Operator::showMessage('.', false, true);
         } while (0 < $processed && !\Includes\Decorator\Utils\CacheManager::isTimeExceeds(static::STEP_TTL));
     }
 }