HHVM: In APC cache clear, only request the cache key in APCIterator.

The default value of the $format parameter of the APCIterator constructur is
APC_ITER_ALL which instructs the iterator to provide all available information
on cache values being iterated over. Only the key value is necessary for
matching and deletion via apc_delete(), though.

This prevents a "Format values FILENAME, DEVICE, INODE, MD5, NUM_HITS, MTIME,
CTIME, DTIME, ATIME, REFCOUNT not supported yet." notice on HHVM.
This commit is contained in:
Andreas Fischer 2014-12-19 03:24:00 +01:00
parent 3036a8714d
commit 0ba5c182f0

View file

@ -32,7 +32,7 @@ class APC extends Cache {
public function clear($prefix = '') {
$ns = $this->getPrefix() . $prefix;
$ns = preg_quote($ns, '/');
$iter = new \APCIterator('user', '/^' . $ns . '/');
$iter = new \APCIterator('user', '/^' . $ns . '/', APC_ITER_KEY);
return apc_delete($iter);
}