Fix php compatibility
This commit is contained in:
parent
af1baf057b
commit
5d31bd441e
@ -93,7 +93,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
|
|||||||
$dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists
|
$dolmemcache->add($memoryid, $data, $expire); // This fails if key already exists
|
||||||
$rescode = $dolmemcache->getResultCode();
|
$rescode = $dolmemcache->getResultCode();
|
||||||
if ($rescode == 0) {
|
if ($rescode == 0) {
|
||||||
return is_countable($data) ? count($data) : 0;
|
return is_array($data) ? count($data) : 0;
|
||||||
} else {
|
} else {
|
||||||
return -$rescode;
|
return -$rescode;
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
|
|||||||
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
|
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
|
||||||
$result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists
|
$result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return is_countable($data) ? count($data) : 0;
|
return is_array($data) ? count($data) : 0;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user