diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-05-03 14:22:02 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-05-08 11:20:49 +0200 |
commit | dd430c2fd72e2d77d69ab93090b5fb6ea6ba76a6 (patch) | |
tree | 695d26ae62df603571a04636af4db4bcc4082662 /apps/dav/lib/AppInfo | |
parent | 303c0dd6a8d2f614841b4ebdacff9ced7120a9e3 (diff) | |
download | nextcloud-server-dd430c2fd72e2d77d69ab93090b5fb6ea6ba76a6.tar.gz nextcloud-server-dd430c2fd72e2d77d69ab93090b5fb6ea6ba76a6.zip |
Cache the carddav photo endpoint
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/AppInfo')
-rw-r--r-- | apps/dav/lib/AppInfo/Application.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php index b4f16f3cadf..d13f24d369a 100644 --- a/apps/dav/lib/AppInfo/Application.php +++ b/apps/dav/lib/AppInfo/Application.php @@ -24,11 +24,13 @@ */ namespace OCA\DAV\AppInfo; +use OC\AppFramework\Utility\SimpleContainer; use OCA\DAV\CalDAV\Activity\Backend; use OCA\DAV\CalDAV\Activity\Provider\Event; use OCA\DAV\CalDAV\BirthdayService; use OCA\DAV\Capabilities; use OCA\DAV\CardDAV\ContactsManager; +use OCA\DAV\CardDAV\PhotoCache; use OCA\DAV\CardDAV\SyncService; use OCA\DAV\HookManager; use \OCP\AppFramework\App; @@ -44,10 +46,19 @@ class Application extends App { public function __construct() { parent::__construct('dav'); + $container = $this->getContainer(); + $server = $container->getServer(); + + $container->registerService(PhotoCache::class, function(SimpleContainer $s) use ($server) { + return new PhotoCache( + $server->getAppDataDir('dav-photocache') + ); + }); + /* * Register capabilities */ - $this->getContainer()->registerCapability(Capabilities::class); + $container->registerCapability(Capabilities::class); } /** |