$missIndexes,
$this->asyncWrites,
'set',
+ // @TODO: consider using self::WRITE_ALLOW_SEGMENTS here?
[ $key, $value, self::UPGRADE_TTL ]
);
}
return $value;
}
+
public function set( $key, $value, $exptime = 0, $flags = 0 ) {
return $this->doWrite(
$this->cacheIndexes,
// Only the first cache is locked
return $this->caches[0]->unlock( $key );
}
- /**
- * Delete objects expiring before a certain date.
- *
- * Succeed if any of the child caches succeed.
- * @param string $date
- * @param bool|callable $progressCallback
- * @return bool
- */
- public function deleteObjectsExpiringBefore( $date, $progressCallback = false ) {
+
+ public function deleteObjectsExpiringBefore(
+ $timestamp,
+ callable $progressCallback = null,
+ $limit = INF
+ ) {
$ret = false;
foreach ( $this->caches as $cache ) {
- if ( $cache->deleteObjectsExpiringBefore( $date, $progressCallback ) ) {
+ if ( $cache->deleteObjectsExpiringBefore( $timestamp, $progressCallback, $limit ) ) {
$ret = true;
}
}
public function clearLastError() {
$this->caches[0]->clearLastError();
}
+
/**
* Apply a write method to the backing caches specified by $indexes (in order)
*
* @param int[] $indexes List of backing cache indexes
* @param bool $asyncWrites
* @param string $method Method name of backing caches
- * @param array[] $args Arguments to the method of backing caches
+ * @param array $args Arguments to the method of backing caches
* @return bool
*/
protected function doWrite( $indexes, $asyncWrites, $method, array $args ) {
protected function doGet( $key, $flags = 0, &$casToken = null ) {
throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
}
+
+ protected function doSet( $key, $value, $exptime = 0, $flags = 0 ) {
+ throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+ }
+
+ protected function doDelete( $key, $flags = 0 ) {
+ throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+ }
+
+ protected function doGetMulti( array $keys, $flags = 0 ) {
+ throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+ }
+
+ protected function serialize( $value ) {
+ throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+ }
+
+ protected function unserialize( $value ) {
+ throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+ }
}