__METHOD__ . ': the "readFactory" parameter is required' );
}
+ $opts = [ 'reportDupes' => false ]; // redundant
$this->writeStore = ( $params['writeFactory'] instanceof BagOStuff )
? $params['writeFactory']
- : ObjectFactory::getObjectFromSpec( $params['writeFactory'] );
+ : ObjectFactory::getObjectFromSpec( $opts + $params['writeFactory'] );
$this->readStore = ( $params['readFactory'] instanceof BagOStuff )
? $params['readFactory']
- : ObjectFactory::getObjectFromSpec( $params['readFactory'] );
+ : ObjectFactory::getObjectFromSpec( $opts + $params['readFactory'] );
+ $this->attrMap = $this->mergeFlagMaps( [ $this->readStore, $this->writeStore ] );
}
public function setDebug( $debug ) {
: $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() {