Skip to content

Commit 98dc8d9

Browse files
committed
updated lof all module
1 parent b06b033 commit 98dc8d9

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Observer/AdminSystemConfigSave.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,25 @@
2828
class AdminSystemConfigSave implements ObserverInterface
2929
{
3030
protected $configWriter;
31+
protected $_cacheTypeList;
32+
protected $_cacheFrontendPool;
3133

3234
public function __construct(
3335
\Magento\Framework\App\Config\Storage\WriterInterface $configWriter
3436
) {
3537
$this->configWriter = $configWriter;
36-
}
38+
$this->_cacheTypeList = $cacheTypeList;
39+
$this->_cacheFrontendPool = $cacheFrontendPool;
40+
}
41+
protected function flushCache(){
42+
$types = array('config','layout','block_html','full_page');
43+
foreach ($types as $type) {
44+
$this->_cacheTypeList->cleanType($type);
45+
}
46+
foreach ($this->_cacheFrontendPool as $cacheFrontend) {
47+
$cacheFrontend->getBackend()->clean();
48+
}
49+
}
3750

3851
public function execute(\Magento\Framework\Event\Observer $observer)
3952
{
@@ -52,6 +65,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
5265
$this->configWriter->save('loflicense/general/'.$key, $module_license_key, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0);
5366
}
5467
}
68+
$this->flushCache();
5569
}
5670
}
5771
}

0 commit comments

Comments
 (0)