1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-08 16:02:40 +01:00

APC: Set ttl to 0 when ttl is not given

Summary:
Passing null as a value for parameter $ttl is deprecated.
Omitting the parameter is considered to be equivalent to 0.

Bug: T15064

Test Plan: * Looked in the deprecation log and did not see a deprecation message from apc.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25833
This commit is contained in:
mainframe98 2024-10-27 15:02:52 +01:00
parent d643ca4c4c
commit 74bf6c0e3c

View file

@ -38,12 +38,16 @@ final class PhutilAPCKeyValueCache extends PhutilKeyValueCache {
return $results;
}
public function setKeys(array $keys, $ttl = null) {
public function setKeys(array $keys, $ttl = 0) {
static $is_apcu;
if ($is_apcu === null) {
$is_apcu = self::isAPCu();
}
if ($ttl === null) {
$ttl = 0;
}
// NOTE: Although modern APC supports passing an array to `apc_store()`,
// it is not supported by older version of APC or by HPHP.