Ejemplo n.º 1
0
 function __construct($bin, $options, $default_options)
 {
     // Assign the path on the following order: bin specific -> default specific -> /tmp/filepath
     if (isset($options['path'])) {
         $this->fspath = $options['path'];
     } elseif (isset($default_options['path'])) {
         $this->fspath = $default_options['path'];
     }
     if (substr($this->fspath, -1) == '/') {
         $this->fspath = substr($this->fspath, 0, strlen($this->fspath) - 2);
     }
     parent::__construct($bin, $options, $default_options);
 }
Ejemplo n.º 2
0
 function __construct($bin, $options, $default_options)
 {
     // Assign the servers on the following order: bin specific -> default specific -> localhost port 11211
     if (isset($options['servers'])) {
         $this->settings['servers'] = $options['servers'];
         $this->settings['compress'] = isset($options['compress']) ? MEMCACHE_COMPRESSED : 0;
         $this->settings['shared'] = isset($options['shared']) ? $options['shared'] : TRUE;
     } else {
         if (isset($default_options['servers'])) {
             $this->settings['servers'] = $default_options['servers'];
             $this->settings['compress'] = isset($default_options['compress']) ? MEMCACHE_COMPRESSED : 0;
             $this->settings['shared'] = isset($default_options['shared']) ? $default_options['shared'] : TRUE;
         } else {
             $this->settings['servers'] = array('localhost:11211');
             $this->settings['compress'] = 0;
             $this->settings['shared'] = TRUE;
         }
     }
     parent::__construct($bin, $options, $default_options);
     $this->connect();
 }