18 import(
'lib.pkp.classes.cache.GenericCache');
50 $this->connection =
new Memcached;
54 if (!$this->connection->addServer($hostname, $port)) {
55 $this->connection =
null;
73 $this->expire = $expiry;
80 $this->connection->flush();
89 if ($this->connection->getResultCode() == Memcached::RES_NOTFOUND) {
92 switch (get_class($result)) {
93 case 'memcache_false':
108 if ($value ===
false) {
110 } elseif ($value ===
null) {
113 return ($this->connection->set($this->getContext() .
':' . $this->getCacheId() .
':' . $id, $value, $this->expire));
120 $this->connection->quit();
121 unset ($this->connection);
122 $this->contextChecked =
false;
146 foreach ($contents as $id => $value) {