コード例 #1
0
 /**
  * @param  array  $configs
  *
  * @return void
  */
 public function changeConfigs(array $configs)
 {
     foreach ($configs as $config) {
         $config = array_merge($this->defaultConfig, $config);
         if ($this->isValidConfig($config)) {
             $this->changeConfig($config['path'], $config['value'], $config['scope_type'], $config['scope_code']);
         }
     }
     $this->cache->clean();
 }
コード例 #2
0
 /**
  * Clear attributes cache
  *
  * @return bool
  */
 public function clear()
 {
     unset($this->attributeInstances);
     if ($this->isAttributeCacheEnabled()) {
         $this->cache->clean([\Magento\Eav\Model\Cache\Type::CACHE_TAG, \Magento\Eav\Model\Entity\Attribute::CACHE_TAG]);
     }
     return true;
 }
コード例 #3
0
ファイル: Config.php プロジェクト: whoople/magento2-testing
 /**
  * Reset object state
  *
  * @return $this
  */
 public function clear()
 {
     $this->_entityTypeData = null;
     $this->_attributeData = null;
     $this->_objects = null;
     $this->_references = null;
     $this->_attributeCodes = null;
     $this->_cache->clean([\Magento\Eav\Model\Cache\Type::CACHE_TAG, \Magento\Eav\Model\Entity\Attribute::CACHE_TAG]);
     return $this;
 }
コード例 #4
0
ファイル: Save.php プロジェクト: nblair/magescotch
 /**
  * Process saving new encryption key
  *
  * @return void
  */
 public function executeInternal()
 {
     try {
         $key = null;
         if (0 == $this->getRequest()->getPost('generate_random')) {
             $key = $this->getRequest()->getPost('crypt_key');
             if (empty($key)) {
                 throw new \Exception(__('Please enter an encryption key.'));
             }
             $this->encryptor->validateKey($key);
         }
         $newKey = $this->change->changeEncryptionKey($key);
         $this->messageManager->addSuccessMessage(__('The encryption key has been changed.'));
         if (!$key) {
             $this->messageManager->addNoticeMessage(__('This is your new encryption key: <span style="font-family:monospace;">%1</span>. ' . 'Be sure to write it down and take good care of it!', $newKey));
         }
         $this->cache->clean();
     } catch (\Exception $e) {
         $this->messageManager->addErrorMessage($e->getMessage());
         $this->_session->setFormData(['crypt_key' => $key]);
     }
     $this->_redirect('adminhtml/*/');
 }
コード例 #5
0
 /**
  * Remove model object related cache
  *
  * @return $this
  */
 public function cleanModelCache()
 {
     $tags = $this->getCacheTags();
     if ($tags !== false) {
         $this->_cacheManager->clean($tags);
     }
     return $this;
 }
コード例 #6
0
 /**
  * Move tree after
  *
  * @return $this
  */
 protected function _afterMove()
 {
     $this->_cache->clean([\Magento\Catalog\Model\Category::CACHE_TAG]);
     return $this;
 }
コード例 #7
0
ファイル: Url.php プロジェクト: Doability/magento2dev
 /**
  * Refresh admin menu cache etc.
  *
  * @return void
  */
 public function renewSecretUrls()
 {
     $this->_cache->clean([\Magento\Backend\Block\Menu::CACHE_TAGS]);
 }
コード例 #8
0
ファイル: EavSetup.php プロジェクト: whoople/magento2-testing
 /**
  * Clean cache
  *
  * @return $this
  */
 public function cleanCache()
 {
     $this->cache->clean([\Magento\Eav\Model\Cache\Type::CACHE_TAG]);
     return $this;
 }
コード例 #9
0
ファイル: Setup.php プロジェクト: aiesh/magento2
 /**
  * Clean cache
  *
  * @return $this
  */
 public function cleanCache()
 {
     $this->_cache->clean(array(\Magento\Eav\Model\Cache\Type::CACHE_TAG));
     return $this;
 }
コード例 #10
0
ファイル: Installer.php プロジェクト: aiesh/magento2
 /**
  * Ensure changes in the configuration, if any, take effect
  *
  * @return void
  */
 protected function _refreshConfig()
 {
     $this->_cache->clean();
     $this->_config->reinit();
 }
コード例 #11
0
ファイル: Cache.php プロジェクト: smile-sa/elasticsuite
 /**
  * Clean the cache by index identifier and store.
  *
  * @param string $indexIdentifier Index identifier.
  * @param string $storeId         Store id.
  *
  * @return void
  */
 public function cleanIndexCache($indexIdentifier, $storeId)
 {
     $cacheTags = $this->getCacheTags($indexIdentifier, $storeId);
     $this->cache->clean($cacheTags);
 }
コード例 #12
0
 public function cleanDownCachedRates()
 {
     $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [self::CACHE_TAG]);
 }