Use $server->getMemCacheFactory() in ldap connection
This commit is contained in:
parent
5a2a0426a6
commit
d50c7391d8
2 changed files with 10 additions and 1 deletions
|
@ -51,7 +51,7 @@ class Connection extends LDAPUtility {
|
|||
$this->configPrefix = $configPrefix;
|
||||
$this->configID = $configID;
|
||||
$this->configuration = new Configuration($configPrefix);
|
||||
$memcache = new \OC\Memcache\Factory();
|
||||
$memcache = \OC::$server->getMemCacheFactory();
|
||||
if($memcache->isAvailable()) {
|
||||
$this->cache = $memcache->create();
|
||||
} else {
|
||||
|
|
|
@ -10,8 +10,17 @@ namespace OCP;
|
|||
|
||||
interface CacheFactory{
|
||||
/**
|
||||
* Get a memory cache instance
|
||||
*
|
||||
* @param string $prefix
|
||||
* @return $return \OCP\ICache
|
||||
*/
|
||||
public function create($prefix = '');
|
||||
|
||||
/**
|
||||
* Check if a memory cache backend is available
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isAvailable();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue