aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/AppInfo/PluginManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/AppInfo/PluginManager.php')
-rw-r--r--apps/dav/lib/AppInfo/PluginManager.php49
1 files changed, 12 insertions, 37 deletions
diff --git a/apps/dav/lib/AppInfo/PluginManager.php b/apps/dav/lib/AppInfo/PluginManager.php
index 0b83d6a9205..428547e3f61 100644
--- a/apps/dav/lib/AppInfo/PluginManager.php
+++ b/apps/dav/lib/AppInfo/PluginManager.php
@@ -3,32 +3,14 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2016, ownCloud GmbH.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Georg Ehrke <oc.list@georgehrke.com>
- * @author Julius Härtl <jus@bitgrid.net>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- * @author Vincent Petry <vincent@nextcloud.com>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud GmbH.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OCA\DAV\AppInfo;
use OC\ServerContainer;
+use OCA\DAV\CalDAV\AppCalendar\AppCalendarPlugin;
use OCA\DAV\CalDAV\Integration\ICalendarProvider;
use OCA\DAV\CardDAV\Integration\IAddressBookProvider;
use OCP\App\IAppManager;
@@ -46,16 +28,6 @@ use function is_array;
class PluginManager {
/**
- * @var ServerContainer
- */
- private $container;
-
- /**
- * @var IAppManager
- */
- private $appManager;
-
- /**
* App plugins
*
* @var ServerPlugin[]
@@ -92,9 +64,10 @@ class PluginManager {
* @param ServerContainer $container server container for resolving plugin classes
* @param IAppManager $appManager app manager to loading apps and their info
*/
- public function __construct(ServerContainer $container, IAppManager $appManager) {
- $this->container = $container;
- $this->appManager = $appManager;
+ public function __construct(
+ private ServerContainer $container,
+ private IAppManager $appManager,
+ ) {
}
/**
@@ -144,7 +117,9 @@ class PluginManager {
}
$this->populated = true;
- foreach ($this->appManager->getInstalledApps() as $app) {
+ $this->calendarPlugins[] = $this->container->get(AppCalendarPlugin::class);
+
+ foreach ($this->appManager->getEnabledApps() as $app) {
// load plugins and collections from info.xml
$info = $this->appManager->getAppInfo($app);
if (!isset($info['types']) || !in_array('dav', $info['types'], true)) {
@@ -253,7 +228,7 @@ class PluginManager {
private function createClass(string $className): object {
try {
- return $this->container->query($className);
+ return $this->container->get($className);
} catch (QueryException $e) {
if (class_exists($className)) {
return new $className();