protected function setUp() { $this->_config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Framework\\App\\Config\\MutableScopeConfigInterface'); $data = ['access_list' => 'localhost', 'backend_host' => 'localhost', 'backend_port' => 8080, 'ttl' => 120]; $this->_config->setValue('system/full_page_cache/default', $data); $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\PageCache\\Model\\System\\Config\\Backend\\Varnish'); }
/** * Execute command * * @return string */ public function execute() { if ($this->_days > 0) { $this->_mutableConfig->setValue(\Magento\Log\Model\Log::XML_LOG_CLEAN_DAYS, $this->_days, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); } /** @var $model \Magento\Log\Model\Log */ $model = $this->_logFactory->create(); $model->clean(); return "Log cleaned\n"; }
/** * @param \Magento\Framework\Event\Observer $observer * * @return $this */ public function controllerActionPredispatch(\Magento\Framework\Event\Observer $observer) { $this->_helper->log($observer->getEvent()->getName(), true); if ($this->_helper->shouldShowTemplatePathHints()) { $this->_mutableConfig->setValue(\MagePsycho\Easypathhints\Helper\Data::XML_PATH_DEV_DEBUG_TEMPLATE_HINTS, 1, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $this->_mutableConfig->setValue(\MagePsycho\Easypathhints\Helper\Data::XML_PATH_DEV_DEBUG_TEMPLATE_HINTS_BLOCKS, 1, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); if ($this->_helper->getShowProfiler()) { $_SERVER['MAGE_PROFILER'] = 'html'; } } return $this; }
/** * Set current VDE theme * * @return void */ protected function _setTheme() { if ($this->_themeContext->getEditableTheme()) { $themeId = $this->_themeContext->getVisibleTheme()->getId(); $this->_mutableConfig->setValue(\Magento\Framework\View\DesignInterface::XML_PATH_THEME_ID, $themeId, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $this->_configuration->setValue(\Magento\Framework\View\DesignInterface::XML_PATH_THEME_ID, $themeId); } }
/** * Enable or disable carrier * @return boolean */ protected function tempSetCarrierEnabled($carrierCode, $enabled, $storeId) { $carrierPath = 'carriers/' . $carrierCode . '/active'; $tempEnabledCarrier = false; if (!$this->shipperDataHelper->getConfigFlag($carrierPath) || !$enabled) { // if $enabled set to false was previously enabled! $this->mutableConfig->setValue($carrierPath, $enabled, 'store', $storeId); $tempEnabledCarrier = true; } return $tempEnabledCarrier; }
/** * @return $this */ public function afterSave() { $this->_mutableConfig->setValue(\Magento\Store\Model\Store::XML_PATH_STORE_IN_URL, $this->getValue(), \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $this->_cacheManager->clean(); return parent::afterSave(); }
/** * Rewrite config from integration config to global config */ public function rewriteAdditionalConfig() { foreach ($this->configData as $path => $value) { $this->mutableScopeConfig->setValue($path, $value, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); } }