mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
refactor(Server): Deprecate \OCP\ICache service and replace it with a distributed cache
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
24f7a2e680
commit
57191d451f
1 changed files with 7 additions and 1 deletions
|
|
@ -588,7 +588,13 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
$this->registerAlias(IURLGenerator::class, URLGenerator::class);
|
||||
|
||||
$this->registerService(ICache::class, function ($c) {
|
||||
return new Cache\File();
|
||||
/** @var LoggerInterface $logger */
|
||||
$logger = $c->get(LoggerInterface::class);
|
||||
$logger->debug('The requested service "' . ICache::class . '" is deprecated. Please use "' . ICacheFactory::class . '" instead to create a cache. This service will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
|
||||
|
||||
/** @var ICacheFactory $cacheFactory */
|
||||
$cacheFactory = $c->get(ICacheFactory::class);
|
||||
return $cacheFactory->createDistributed();
|
||||
});
|
||||
|
||||
$this->registerService(Factory::class, function (Server $c) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue