/**
* Constructor. Parameters are:
- * - writeFactory : ObjectFactory::getObjectFromSpec parameters yeilding BagOStuff.
+ * - writeFactory : ObjectFactory::getObjectFromSpec array yeilding BagOStuff.
* This object will be used for writes (e.g. the master DB).
- * - readFactory : ObjectFactory::getObjectFromSpec parameters yeilding BagOStuff.
+ * - readFactory : ObjectFactory::getObjectFromSpec array yeilding BagOStuff.
* This object will be used for reads (e.g. a slave DB).
*
* @param array $params
$this->readStore->setDebug( $debug );
}
- public function get( $key, &$casToken = null, $flags = 0 ) {
+ protected function doGet( $key, $flags = 0 ) {
return ( $flags & self::READ_LATEST )
- ? $this->writeStore->get( $key, $casToken, $flags )
- : $this->readStore->get( $key, $casToken, $flags );
+ ? $this->writeStore->get( $key, $flags )
+ : $this->readStore->get( $key, $flags );
}
public function getMulti( array $keys, $flags = 0 ) {
: $this->readStore->getMulti( $keys, $flags );
}
- public function set( $key, $value, $exptime = 0 ) {
- return $this->writeStore->set( $key, $value, $exptime );
+ public function set( $key, $value, $exptime = 0, $flags = 0 ) {
+ return $this->writeStore->set( $key, $value, $exptime, $flags );
}
public function delete( $key ) {
return $this->writeStore->unlock( $key );
}
- public function merge( $key, $callback, $exptime = 0, $attempts = 10 ) {
- return $this->writeStore->merge( $key, $callback, $exptime, $attempts );
+ public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
+ return $this->writeStore->merge( $key, $callback, $exptime, $attempts, $flags );
}
public function getLastError() {