namespace Friendica\Core\Cache;
use Friendica\Core\Cache;
+use Friendica\Core\Logger;
use Exception;
-use Friendica\Network\HTTPException\InternalServerErrorException;
use Memcached;
/**
$this->memcached = new Memcached();
-
- $this->memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, false);
-
array_walk($memcached_hosts, function (&$value) {
if (is_string($value)) {
$value = array_map('trim', explode(',', $value));
if ($this->memcached->getResultCode() == Memcached::RES_SUCCESS) {
return $this->filterArrayKeysByPrefix($keys, $prefix);
} else {
- logger('Memcached \'getAllKeys\' failed with ' . $this->memcached->getResultMessage(), LOGGER_ALL);
+ Logger::log('Memcached \'getAllKeys\' failed with ' . $this->memcached->getResultMessage(), Logger::ALL);
return [];
}
}
*/
public function get($key)
{
+ $return = null;
$cachekey = $this->getCacheKey($key);
// We fetch with the hostname as key to avoid problems with other applications
$value = $this->memcached->get($cachekey);
if ($this->memcached->getResultCode() === Memcached::RES_SUCCESS) {
- return $value;
+ $return = $value;
} else {
- logger('Memcached \'get\' failed with ' . $this->memcached->getResultMessage(), LOGGER_ALL);
- return [];
+ Logger::log('Memcached \'get\' failed with ' . $this->memcached->getResultMessage(), Logger::ALL);
}
+
+ return $return;
}
/**