]> source.dussan.org Git - nextcloud-server.git/commitdiff
Reuse backend as provided by the app container
authorThomas Müller <thomas.mueller@tmit.eu>
Tue, 12 Jan 2016 13:27:50 +0000 (14:27 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 12 Jan 2016 13:27:50 +0000 (14:27 +0100)
apps/dav/appinfo/app.php

index f6c74c9c943c89519166d40e372c47d904ff91c2..51689b965da9d0b9ed577d2a09b46c21d55ee013 100644 (file)
 
 use OCA\DAV\CardDAV\CardDavBackend;
 use OCA\DAV\CardDAV\SyncService;
-use OCA\DAV\Connector\Sabre\Principal;
 
 \OC::$server->registerService('CardDAVSyncService', function() {
 
-       $userManager = \OC::$server->getUserManager();
-       $dbConnection = \OC::$server->getDatabaseConnection();
-
-       $principalBackend = new Principal(
-               $userManager
-       );
-
-       $backend = new CardDavBackend($dbConnection, $principalBackend);
+       $app = new \OCA\Dav\AppInfo\Application();
+       /** @var CardDavBackend */
+       $backend = $app->getContainer()->query('CardDavBackend');
 
        return new SyncService($backend);
 });