1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-24 13:52:56 +02:00

Flextype Core: Cache - updates #165

- new method clearAll() added.
- method clear() should have parameter $id
This commit is contained in:
Awilum
2019-06-22 20:06:42 +03:00
parent 0857e13935
commit a26df886ab

View File

@@ -358,7 +358,7 @@ class Cache
/**
* Clear Cache
*/
public function clear() : void
public function clear(string $id) : void
{
// Clear stat cache
@clearstatcache();
@@ -367,8 +367,22 @@ class Cache
function_exists('opcache_reset') and @opcache_reset();
// Remove cache dirs
Filesystem::deleteDir(PATH['cache'] . '/doctrine/');
Filesystem::deleteDir(PATH['cache'] . '/glide/');
Filesystem::deleteDir(PATH['cache'] . '/' . $id);
}
/**
* Clear ALL Cache
*/
public function clearAll() : void
{
// Clear stat cache
@clearstatcache();
// Clear opcache
function_exists('opcache_reset') and @opcache_reset();
// Remove cache directory
Filesystem::deleteDir(PATH['cache']);
}
/**