Esempio n. 1
0
 /**
  * Limit the cleaning scope within a tag
  *
  * {@inheritdoc}
  */
 public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, array $tags = [])
 {
     if ($mode == \Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG) {
         $result = false;
         foreach ($tags as $tag) {
             if (parent::clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [$tag, $this->_tag])) {
                 $result = true;
             }
         }
     } else {
         if ($mode == \Zend_Cache::CLEANING_MODE_ALL) {
             $mode = \Zend_Cache::CLEANING_MODE_MATCHING_TAG;
             $tags = [$this->_tag];
         } else {
             $tags[] = $this->_tag;
         }
         $result = parent::clean($mode, $tags);
     }
     return $result;
 }
Esempio n. 2
0
 /**
  * @param \Magento\Framework\Cache\FrontendInterface $frontend
  * @param array $params
  */
 public function __construct(\Magento\Framework\Cache\FrontendInterface $frontend, array $params)
 {
     parent::__construct($frontend);
     $this->_params = $params;
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, array $tags = array())
 {
     if (!$this->_isEnabled()) {
         return true;
     }
     return parent::clean($mode, $tags);
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, array $tags = array())
 {
     \Magento\Framework\Profiler::start('cache_clean', $this->_getProfilerTags('clean'));
     $result = parent::clean($mode, $tags);
     \Magento\Framework\Profiler::stop('cache_clean');
     return $result;
 }
Esempio n. 5
0
 /**
  * {@inheritdoc}
  */
 public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, array $tags = [])
 {
     $result = parent::clean($mode, $tags, $mode);
     $this->log(compact('tags', 'mode'));
     return $result;
 }