}
protected function doGet( $key, $flags = 0 ) {
- return $this->getUnserialize(
- apcu_fetch( $key . self::KEY_SUFFIX )
- );
+ return $this->unserialize( apcu_fetch( $key . self::KEY_SUFFIX ) );
+ }
+
+ protected function getWithToken( $key, &$casToken, $flags = 0 ) {
+ $casToken = null;
+
+ $blob = apcu_fetch( $key . self::KEY_SUFFIX );
+ $value = $this->unserialize( $blob );
+ if ( $value !== false ) {
+ $casToken = $blob; // don't bother hashing this
+ }
+
+ return $value;
}
public function set( $key, $value, $exptime = 0, $flags = 0 ) {
apcu_store(
$key . self::KEY_SUFFIX,
- $this->setSerialize( $value ),
+ $this->serialize( $value ),
$exptime
);
return true;
}
+ public function add( $key, $value, $exptime = 0, $flags = 0 ) {
+ return apcu_add(
+ $key . self::KEY_SUFFIX,
+ $this->serialize( $value ),
+ $exptime
+ );
+ }
+
public function delete( $key, $flags = 0 ) {
apcu_delete( $key . self::KEY_SUFFIX );
return false;
}
}
+
+ public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
+ return $this->mergeViaCas( $key, $callback, $exptime, $attempts, $flags );
+ }
}