Skip to content

Commit 1c4a3cd

Browse files
committed
Create cacheflush.php
1 parent ad67fc5 commit 1c4a3cd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Diff for: cacheflush.php

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
use Magento\Framework\App\Bootstrap;
4+
5+
require __DIR__ . '/app/bootstrap.php';
6+
7+
$bootstrap = Bootstrap::create(BP, $_SERVER);
8+
$objectManager = $bootstrap->getObjectManager();
9+
10+
11+
try{
12+
$_cacheTypeList = $objectManager->create('Magento\Framework\App\Cache\TypeListInterface');
13+
$_cacheFrontendPool = $objectManager->create('Magento\Framework\App\Cache\Frontend\Pool');
14+
$types = array('config','layout','block_html','collections','reflection','db_ddl','eav','config_integration','config_integration_api','full_page','translate','config_webservice');
15+
foreach ($types as $type) {
16+
$_cacheTypeList->cleanType($type);
17+
}
18+
foreach ($_cacheFrontendPool as $cacheFrontend) {
19+
$cacheFrontend->getBackend()->clean();
20+
}
21+
}catch(Exception $e){
22+
echo $msg = 'Error : '.$e->getMessage();die();
23+
}

0 commit comments

Comments
 (0)