]> source.dussan.org Git - nextcloud-server.git/commitdiff
Migrate files sharing to the PSR container 21862/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 16 Jul 2020 08:27:44 +0000 (10:27 +0200)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 16 Jul 2020 13:52:46 +0000 (15:52 +0200)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
apps/files_sharing/lib/AppInfo/Application.php

index acf1462601d56a7f7494c53ef44339c71d1dad0d..1b1bd08d3fdaeff58fc256074e59a03510a9c422 100644 (file)
@@ -50,13 +50,15 @@ use OCA\Files\Event\LoadAdditionalScriptsEvent;
 use OCA\Files\Event\LoadSidebar;
 use OCP\AppFramework\App;
 use OCP\EventDispatcher\IEventDispatcher;
+use OCP\Federation\ICloudIdManager;
 use OCP\Files\Config\IMountProviderCollection;
 use OCP\Group\Events\UserAddedEvent;
-use OCP\IContainer;
+use OCP\IDBConnection;
 use OCP\IGroup;
 use OCP\IServerContainer;
 use OCP\Share\Events\ShareCreatedEvent;
 use OCP\Util;
+use Psr\Container\ContainerInterface;
 use Symfony\Component\EventDispatcher\GenericEvent;
 
 class Application extends App {
@@ -103,15 +105,13 @@ class Application extends App {
                $container->registerMiddleWare(OCSShareAPIMiddleware::class);
                $container->registerMiddleWare(ShareInfoMiddleware::class);
 
-               $container->registerService('ExternalMountProvider', function (IContainer $c) {
-                       /** @var \OCP\IServerContainer $server */
-                       $server = $c->query('ServerContainer');
+               $container->registerService('ExternalMountProvider', function (ContainerInterface $c) {
                        return new \OCA\Files_Sharing\External\MountProvider(
-                               $server->getDatabaseConnection(),
+                               $c->get(IDBConnection::class),
                                function () use ($c) {
-                                       return $c->query(Manager::class);
+                                       return $c->get(Manager::class);
                                },
-                               $server->getCloudIdManager()
+                               $c->get(ICloudIdManager::class)
                        );
                });