diff --git a/build/integration/features/bootstrap/RemoteContext.php b/build/integration/features/bootstrap/RemoteContext.php index a3e5e1b500745..e9334e1e42e9f 100644 --- a/build/integration/features/bootstrap/RemoteContext.php +++ b/build/integration/features/bootstrap/RemoteContext.php @@ -23,6 +23,7 @@ * */ use Behat\Behat\Context\Context; +use OCP\ICacheFactory; use PHPUnit\Framework\Assert; require __DIR__ . '/../../vendor/autoload.php'; @@ -66,7 +67,7 @@ public function selectRemoteInstance($remoteServer) { } $this->lastException = null; try { - $this->remoteInstance = new \OC\Remote\Instance($baseUri, \OC::$server->getMemCacheFactory()->createLocal(), \OC::$server->getHTTPClientService()); + $this->remoteInstance = new \OC\Remote\Instance($baseUri, \OC::$server->get(ICacheFactory::class)->createLocal(), \OC::$server->getHTTPClientService()); // trigger the status request $this->remoteInstance->getProtocol(); } catch (\Exception $e) { diff --git a/core/register_command.php b/core/register_command.php index d9e5dfcd775eb..f8dfc952056bf 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -48,6 +48,8 @@ * along with this program. If not, see * */ + +use OCP\ICacheFactory; use Psr\Log\LoggerInterface; $application->add(new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand()); @@ -167,7 +169,7 @@ $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector())); $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig())); $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess()); - $application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory())); + $application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->get(ICacheFactory::class))); $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->get(LoggerInterface::class), \OC::$server->query(\OC\Installer::class))); $application->add(new OC\Core\Command\Maintenance\Repair( diff --git a/lib/private/Files/ObjectStore/Swift.php b/lib/private/Files/ObjectStore/Swift.php index b463cb9d44d94..3e06b1b2ba8ad 100644 --- a/lib/private/Files/ObjectStore/Swift.php +++ b/lib/private/Files/ObjectStore/Swift.php @@ -32,6 +32,7 @@ use OCP\Files\NotFoundException; use OCP\Files\ObjectStore\IObjectStore; use OCP\Files\StorageAuthException; +use OCP\ICacheFactory; use Psr\Log\LoggerInterface; const SWIFT_SEGMENT_SIZE = 1073741824; // 1GB @@ -47,7 +48,7 @@ class Swift implements IObjectStore { public function __construct($params, SwiftFactory $connectionFactory = null) { $this->swiftFactory = $connectionFactory ?: new SwiftFactory( - \OC::$server->getMemCacheFactory()->createDistributed('swift::'), + \OC::$server->get(ICacheFactory::class)->createDistributed('swift::'), $params, \OC::$server->get(LoggerInterface::class) ); diff --git a/lib/private/Repair.php b/lib/private/Repair.php index 05624a2423a22..df150e16b76f1 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -40,6 +40,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Collaboration\Resources\IManager; use OCP\EventDispatcher\IEventDispatcher; +use OCP\ICacheFactory; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; use OC\DB\Connection; @@ -192,7 +193,7 @@ public static function getRepairSteps(): array { new FixMountStorages(\OC::$server->getDatabaseConnection()), new UpdateLanguageCodes(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()), new AddLogRotateJob(\OC::$server->getJobList()), - new ClearFrontendCaches(\OC::$server->getMemCacheFactory(), \OCP\Server::get(JSCombiner::class)), + new ClearFrontendCaches(\OC::$server->get(ICacheFactory::class), \OCP\Server::get(JSCombiner::class)), \OCP\Server::get(ClearGeneratedAvatarCache::class), new AddPreviewBackgroundCleanupJob(\OC::$server->getJobList()), new AddCleanupUpdaterBackupsJob(\OC::$server->getJobList()), diff --git a/tests/lib/AppTest.php b/tests/lib/AppTest.php index 12fbdb011d902..462e3136823e4 100644 --- a/tests/lib/AppTest.php +++ b/tests/lib/AppTest.php @@ -14,6 +14,7 @@ use OC\AppConfig; use OCP\EventDispatcher\IEventDispatcher; use OCP\IAppConfig; +use OCP\ICacheFactory; use Psr\Log\LoggerInterface; /** @@ -559,7 +560,7 @@ private function registerAppConfig(AppConfig $appConfig) { \OC::$server->getConfig(), $appConfig, \OC::$server->getGroupManager(), - \OC::$server->getMemCacheFactory(), + \OC::$server->get(ICacheFactory::class), \OC::$server->get(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class) ));