fix: [internal] Clear also cake core and model caches

pull/5169/head
Jakub Onderka 2019-09-16 19:41:27 +02:00
parent 65121816d5
commit 0924de0440
1 changed files with 7 additions and 5 deletions

View File

@ -1460,13 +1460,15 @@ class AppModel extends Model
public function cleanCacheFiles()
{
Cache::clear();
Cache::clear(false, '_cake_core_');
Cache::clear(false, '_cake_model_');
clearCache();
$files = array();
$files = array_merge($files, glob(CACHE . 'models' . DS . 'myapp*'));
$files = glob(CACHE . 'models' . DS . 'myapp*');
$files = array_merge($files, glob(CACHE . 'persistent' . DS . 'myapp*'));
foreach ($files as $f) {
if (is_file($f)) {
unlink($f);
foreach ($files as $file) {
if (is_file($file)) {
unlink($file);
}
}
}