44 parent::__construct( $params );
48 'compress_threshold' => 1500,
49 'connect_timeout' => 0.5
53 $this->client->set_servers( $params[
'servers'] );
57 parent::debug( $enabled );
58 $this->client->set_debug( $enabled );
61 protected function doGet( $key, $flags = 0, &$casToken =
null ) {
67 protected function doSet( $key, $value, $exptime = 0, $flags = 0 ) {
68 return $this->client->set(
75 protected function doDelete( $key, $flags = 0 ) {
79 protected function doAdd( $key, $value, $exptime = 0, $flags = 0 ) {
80 return $this->client->add(
87 protected function doCas( $casToken, $key, $value, $exptime = 0, $flags = 0 ) {
88 return $this->client->cas(
96 public function incr( $key, $value = 1, $flags = 0 ) {
99 return ( $n !==
false && $n !==
null ) ? $n :
false;
102 public function decr( $key, $value = 1, $flags = 0 ) {
105 return ( $n !==
false && $n !==
null ) ? $n :
false;
109 return $this->client->touch(
116 foreach (
$keys as $key ) {
120 return $this->client->get_multi(
$keys );
124 return is_int( $value ) ? $value : $this->client->serialize( $value );
128 return $this->
isInteger( $value ) ? (int)$value : $this->client->unserialize( $value );