writeStore = ( $params['writeFactory'] instanceof BagOStuff ) ? $params['writeFactory'] : ObjectFactory::getObjectFromSpec( $params['writeFactory'] ); $this->readStore = ( $params['readFactory'] instanceof BagOStuff ) ? $params['readFactory'] : ObjectFactory::getObjectFromSpec( $params['readFactory'] ); } public function setDebug( $debug ) { $this->writeStore->setDebug( $debug ); $this->readStore->setDebug( $debug ); } public function get( $key, &$casToken = null ) { return $this->readStore->get( $key, $casToken ); } public function getMulti( $keys ) { return $this->readStore->getMulti( $keys ); } public function set( $key, $value, $exptime = 0 ) { return $this->writeStore->set( $key, $value, $exptime ); } public function delete( $key ) { return $this->writeStore->delete( $key ); } public function add( $key, $value, $exptime = 0 ) { return $this->writeStore->add( $key, $value, $exptime ); } public function incr( $key, $value = 1 ) { return $this->writeStore->incr( $key, $value ); } public function decr( $key ) { return $this->writeStore->decr( $key ); } public function lock( $key, $timeout = 6, $expiry = 6 ) { return $this->writeStore->lock( $key, $timeout, $expiry ); } public function unlock( $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 getLastError() { return ( $this->writeStore->getLastError() != self::ERR_NONE ) ? $this->writeStore->getLastError() : $this->readStore->getLastError(); } public function clearLastError() { $this->writeStore->clearLastError(); $this->readStore->clearLastError(); } }