Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/cache/PhutilAPCKeyValueCache.php
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | public function setKeys(array $keys, $ttl = null) { | ||||
static $is_apcu; | static $is_apcu; | ||||
if ($is_apcu === null) { | if ($is_apcu === null) { | ||||
$is_apcu = self::isAPCu(); | $is_apcu = self::isAPCu(); | ||||
} | } | ||||
// NOTE: Although modern APC supports passing an array to `apc_store()`, | // NOTE: Although modern APC supports passing an array to `apc_store()`, | ||||
// it is not supported by older version of APC or by HPHP. | // it is not supported by older version of APC or by HPHP. | ||||
// See T13525 for discussion of use of "@" to silence this warning: | |||||
// > GC cache entry "<some-key-name>" was on gc-list for <X> seconds | |||||
foreach ($keys as $key => $value) { | foreach ($keys as $key => $value) { | ||||
if ($is_apcu) { | if ($is_apcu) { | ||||
apcu_store($key, $value, $ttl); | @apcu_store($key, $value, $ttl); | ||||
} else { | } else { | ||||
apc_store($key, $value, $ttl); | @apc_store($key, $value, $ttl); | ||||
} | } | ||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
public function deleteKeys(array $keys) { | public function deleteKeys(array $keys) { | ||||
static $is_apcu; | static $is_apcu; | ||||
Show All 35 Lines |