mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
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
|
||||
$rescode = $dolmemcache->getResultCode();
|
||||
if ($rescode == 0) {
|
||||
return is_countable($data) ? count($data) : 0;
|
||||
return is_array($data) ? count($data) : 0;
|
||||
} else {
|
||||
return -$rescode;
|
||||
}
|
||||
|
|
@ -113,7 +113,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
|
|||
//$dolmemcache->setOption(Memcached::OPT_COMPRESSION, false);
|
||||
$result = $dolmemcache->add($memoryid, $data, false, $expire); // This fails if key already exists
|
||||
if ($result) {
|
||||
return is_countable($data) ? count($data) : 0;
|
||||
return is_array($data) ? count($data) : 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user