N°7405 - Fix unit tests

This commit is contained in:
Eric Espie
2024-04-05 11:29:41 +02:00
parent 1be67f349f
commit 9dc7b6dc0c

View File

@@ -60,14 +60,15 @@ function apc_store($key, $var = NULL, $ttl = 0)
*/ */
function apc_fetch($key) function apc_fetch($key)
{ {
if (is_array($key)) if (is_array($key)) {
{ $aResult = [];
$aResult = array(); foreach ($key as $sKey) {
foreach($key as $sKey)
{
$aResult[$sKey] = apcFile::FetchOneFile($sKey); $aResult[$sKey] = apcFile::FetchOneFile($sKey);
} }
return $aResult; return $aResult;
} elseif (is_null($key)) {
return false;
} }
return apcFile::FetchOneFile($key); return apcFile::FetchOneFile($key);
} }
@@ -214,7 +215,12 @@ class apcFile
if (empty($sKey)) { if (empty($sKey)) {
return false; return false;
} }
if (is_file(self::GetCacheFileName($sKey))) {
@unlink(self::GetCacheFileName($sKey));
}
if (is_file(self::GetCacheFileName('-'.$sKey))) {
@unlink(self::GetCacheFileName('-'.$sKey));
}
if ($iTTL > 0) { if ($iTTL > 0) {
// hint for ttl management // hint for ttl management
$sKey = '-'.$sKey; $sKey = '-'.$sKey;