|
|
|
|
@ -433,7 +433,13 @@ class Server extends ServerContainer implements IServerContainer { |
|
|
|
|
$this->registerAlias('UserCache', \OCP\ICache::class); |
|
|
|
|
|
|
|
|
|
$this->registerService(Factory::class, function (Server $c) { |
|
|
|
|
$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
|
|
|
|
'\\OC\\Memcache\\ArrayCache', |
|
|
|
|
'\\OC\\Memcache\\ArrayCache', |
|
|
|
|
'\\OC\\Memcache\\ArrayCache' |
|
|
|
|
); |
|
|
|
|
$config = $c->getConfig(); |
|
|
|
|
$urlGenerator = new URLGenerator($config, $arrayCacheFactory); |
|
|
|
|
|
|
|
|
|
if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) { |
|
|
|
|
$v = \OC_App::getAppVersions(); |
|
|
|
|
@ -441,19 +447,15 @@ class Server extends ServerContainer implements IServerContainer { |
|
|
|
|
$version = implode(',', $v); |
|
|
|
|
$instanceId = \OC_Util::getInstanceId(); |
|
|
|
|
$path = \OC::$SERVERROOT; |
|
|
|
|
$prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . \OC::$WEBROOT); |
|
|
|
|
$prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . $urlGenerator->getBaseUrl()); |
|
|
|
|
return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
|
|
|
|
$config->getSystemValue('memcache.local', null), |
|
|
|
|
$config->getSystemValue('memcache.distributed', null), |
|
|
|
|
$config->getSystemValue('memcache.locking', null) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
return $arrayCacheFactory; |
|
|
|
|
|
|
|
|
|
return new \OC\Memcache\Factory('', $c->getLogger(), |
|
|
|
|
'\\OC\\Memcache\\ArrayCache', |
|
|
|
|
'\\OC\\Memcache\\ArrayCache', |
|
|
|
|
'\\OC\\Memcache\\ArrayCache' |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
$this->registerAlias('MemCacheFactory', Factory::class); |
|
|
|
|
$this->registerAlias(ICacheFactory::class, Factory::class); |
|
|
|
|
|