Reuse backend as provided by the app container
This commit is contained in:
parent
23a8c93fd2
commit
bf1a2f28c2
1 changed files with 3 additions and 9 deletions
|
@ -21,18 +21,12 @@
|
|||
|
||||
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);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue