Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CleanCache.php
Go to the documentation of this file.
1 <?php
7 
12 {
16  private $cacheFrontendPool;
17 
21  public function __construct(
22  \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool
23  ) {
24  $this->cacheFrontendPool = $cacheFrontendPool;
25  }
26 
32  public function execute()
33  {
35  foreach ($this->cacheFrontendPool as $cacheFrontend) {
36  // Magento cache frontend does not support the 'old' cleaning mode, that's why backend is used directly
37  $cacheFrontend->getBackend()->clean(\Zend_Cache::CLEANING_MODE_OLD);
38  }
39  }
40 }
const CLEANING_MODE_OLD
Definition: Cache.php:73
__construct(\Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool)
Definition: CleanCache.php:21