false ]; // redundant $this->writeStore = ( $params['writeFactory'] instanceof BagOStuff ) ? $params['writeFactory'] : ObjectFactory::getObjectFromSpec( $opts + $params['writeFactory'] ); $this->readStore = ( $params['readFactory'] instanceof BagOStuff ) ? $params['readFactory'] : ObjectFactory::getObjectFromSpec( $opts + $params['readFactory'] ); $this->attrMap = $this->mergeFlagMaps( [ $this->readStore, $this->writeStore ] ); } public function setDebug( $enabled ) { parent::setDebug( $enabled ); $this->writeStore->setDebug( $enabled ); $this->readStore->setDebug( $enabled ); } public function get( $key, $flags = 0 ) { return $this->fieldHasFlags( $flags, self::READ_LATEST ) ? $this->writeStore->get( $key, $flags ) : $this->readStore->get( $key, $flags ); } public function set( $key, $value, $exptime = 0, $flags = 0 ) { return $this->writeStore->set( $key, $value, $exptime, $flags ); } public function delete( $key, $flags = 0 ) { return $this->writeStore->delete( $key, $flags ); } public function add( $key, $value, $exptime = 0, $flags = 0 ) { return $this->writeStore->add( $key, $value, $exptime, $flags ); } public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { return $this->writeStore->merge( $key, $callback, $exptime, $attempts, $flags ); } public function changeTTL( $key, $exptime = 0, $flags = 0 ) { return $this->writeStore->changeTTL( $key, $exptime, $flags ); } public function lock( $key, $timeout = 6, $expiry = 6, $rclass = '' ) { return $this->writeStore->lock( $key, $timeout, $expiry, $rclass ); } public function unlock( $key ) { return $this->writeStore->unlock( $key ); } public function deleteObjectsExpiringBefore( $timestamp, callable $progress = null, $limit = INF ) { return $this->writeStore->deleteObjectsExpiringBefore( $timestamp, $progress, $limit ); } public function getMulti( array $keys, $flags = 0 ) { return $this->fieldHasFlags( $flags, self::READ_LATEST ) ? $this->writeStore->getMulti( $keys, $flags ) : $this->readStore->getMulti( $keys, $flags ); } public function setMulti( array $data, $exptime = 0, $flags = 0 ) { return $this->writeStore->setMulti( $data, $exptime, $flags ); } public function deleteMulti( array $keys, $flags = 0 ) { return $this->writeStore->deleteMulti( $keys, $flags ); } public function changeTTLMulti( array $keys, $exptime, $flags = 0 ) { return $this->writeStore->changeTTLMulti( $keys, $exptime, $flags ); } public function incr( $key, $value = 1, $flags = 0 ) { return $this->writeStore->incr( $key, $value, $flags ); } public function decr( $key, $value = 1, $flags = 0 ) { return $this->writeStore->decr( $key, $value, $flags ); } public function incrWithInit( $key, $exptime, $value = 1, $init = null, $flags = 0 ) { return $this->writeStore->incrWithInit( $key, $exptime, $value, $init, $flags ); } public function getLastError() { return ( $this->writeStore->getLastError() != self::ERR_NONE ) ? $this->writeStore->getLastError() : $this->readStore->getLastError(); } public function clearLastError() { $this->writeStore->clearLastError(); $this->readStore->clearLastError(); } public function makeKeyInternal( $keyspace, $args ) { return $this->writeStore->makeKeyInternal( ...func_get_args() ); } public function makeKey( $class, ...$components ) { return $this->writeStore->makeKey( ...func_get_args() ); } public function makeGlobalKey( $class, ...$components ) { return $this->writeStore->makeGlobalKey( ...func_get_args() ); } public function addBusyCallback( callable $workCallback ) { $this->writeStore->addBusyCallback( $workCallback ); } public function setMockTime( &$time ) { parent::setMockTime( $time ); $this->writeStore->setMockTime( $time ); $this->readStore->setMockTime( $time ); } }