Skip to content

Commit

Permalink
Merge pull request #964 from stell-hawk/alpha
Browse files Browse the repository at this point in the history
Исправлена ошибка префикса в кеше
  • Loading branch information
sergejey authored Jun 8, 2021
2 parents 77e58a0 + 34c7317 commit 6187dfb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/caching.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,30 @@ function clearCacheData($prefix='') {
$redisConnection = new Redis();
$redisConnection->pconnect(USE_REDIS);
}
$redisConnection->flushDB();
if(!prefix)$redisConnection->flushDB();
else
{
$list=$redisConnection->getKeys($prefix."*");
foreach($list as $key1)
$redisConnection->del($key1);
}
return;
}
SQLTruncateTable('cached_values');
if(!prefix)SQLTruncateTable('cached_values');
else SQLExec("delete from cached_values where KEYWORD like '$prefix%'");
if (isset($_SERVER['REQUEST_METHOD'])) {
global $memory_cache;
$memory_cache = array();
}
}

/**
* Return all Cache Data from prefix
* Summary of getAllCache
* @param mixed $prefix prefix
* @param mixed $prefix
* @return array
*/
function getAllCache($prefix)
function getAllCache($prefix='')
{
$prefix=strtolower($prefix);
$out=array();
Expand Down

0 comments on commit 6187dfb

Please sign in to comment.