/** * Constructor * * @param string $uniqId to be used to separate objects in addition to their key identifiers, for instance in a * multi-user scenario. * * @return \iveeCrest\MemcachedWrapper */ public function __construct($uniqId) { $this->memcached = new \Memcached(); $this->memcached->addServer(Config::getCacheHost(), Config::getCachePort()); $this->memcached->setOption(\Memcached::OPT_PREFIX_KEY, Config::getCachePrefix()); $this->uniqId = $uniqId; }
/** * Constructor. * * @param string $uniqId to be used to separate objects in addition to their key identifiers, for instance in a * multi-user scenario. * * @return \iveeCrest\RedisWrapper */ public function __construct($uniqId) { $this->redis = new \Redis(); $this->redis->connect(Config::getCacheHost(), Config::getCachePort()); $this->redis->setOption(\Redis::OPT_PREFIX, Config::getCachePrefix()); $this->uniqId = $uniqId; }
/** * Constructor. */ protected function __construct() { $this->memcached = new \Memcached(); $this->memcached->addServer(Config::getCacheHost(), Config::getCachePort()); $this->memcached->setOption(\Memcached::OPT_PREFIX_KEY, Config::getCachePrefix()); //determine if deleteMulti() is supported if (defined('HHVM_VERSION')) { $this->hasMultiDelete = false; } else { $ext = new \ReflectionExtension('memcached'); $this->hasMultiDelete = version_compare($ext->getVersion(), '2.0.0', '>='); } }
/** * Constructor. */ protected function __construct() { $this->redis = new \Redis(); $this->redis->connect(Config::getCacheHost(), Config::getCachePort()); $this->redis->setOption(\Redis::OPT_PREFIX, Config::getCachePrefix()); }