1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Fix cache

This commit is contained in:
DanielnetoDotCom 2021-03-12 20:17:49 -03:00
parent e97ed43696
commit 60656845b0

View file

@ -409,6 +409,8 @@ abstract class ObjectYPT implements ObjectInterface
public static function deleteCache($name) public static function deleteCache($name)
{ {
global $__getAVideoCache;
unset($__getAVideoCache);
$cachefile = self::getCacheFileName($name); $cachefile = self::getCacheFileName($name);
@unlink($cachefile); @unlink($cachefile);
self::deleteSessionCache($name); self::deleteSessionCache($name);
@ -416,6 +418,8 @@ abstract class ObjectYPT implements ObjectInterface
} }
static function deleteCachePattern($pattern) { static function deleteCachePattern($pattern) {
global $__getAVideoCache;
unset($__getAVideoCache);
$tmpDir = self::getCacheDir(); $tmpDir = self::getCacheDir();
$array = _glob($tmpDir, $pattern); $array = _glob($tmpDir, $pattern);
foreach ($array as $value) { foreach ($array as $value) {
@ -435,6 +439,8 @@ abstract class ObjectYPT implements ObjectInterface
public static function deleteALLCache() public static function deleteALLCache()
{ {
global $__getAVideoCache;
unset($__getAVideoCache);
$tmpDir = self::getCacheDir(true); $tmpDir = self::getCacheDir(true);
rrmdir($tmpDir); rrmdir($tmpDir);
self::deleteAllSessionCache(); self::deleteAllSessionCache();