Beispiel #1
0
 /**
  * Constructor
  *
  * @param array $options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     $this->conn = new Memcache();
     foreach ($this->options['servers'] as $server) {
         call_user_func_array(array($this->conn, 'addServer'), $server);
     }
 }
Beispiel #2
0
 /**
  * Constructor
  *
  * @param array $options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     if (isset($this->options['persistent'])) {
         $this->conn = new Memcached($this->options['persistent']);
     } else {
         $this->conn = new Memcached();
     }
     $this->conn->addServers($this->options['servers']);
 }
Beispiel #3
0
 /**
  * Constructor
  *
  * @param array $options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     $this->conn = new Redis();
     if (empty($this->options['persistent'])) {
         $this->conn->connect($this->options['host'], $this->options['port'], $this->options['timeout']);
     } else {
         $this->conn->pconnect($this->options['host'], $this->options['port'], $this->options['timeout']);
     }
     foreach ($this->optionKeys as $key) {
         if (isset($this->options[$key])) {
             $this->conn->setOption($key, $this->options[$key]);
         }
     }
 }