aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Connector
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-03-13 00:42:39 +0100
committerMorris Jobke <hey@morrisjobke.de>2019-03-13 00:42:39 +0100
commit389c2095a6130f16f02ca72e09712596e0e48551 (patch)
treef59f8c567b3a1300dfec7ef215d9736387bb98ac /apps/dav/lib/Connector
parent9bb13fb05fffe9af94f1e57866a025382b71f5a4 (diff)
downloadnextcloud-server-389c2095a6130f16f02ca72e09712596e0e48551.tar.gz
nextcloud-server-389c2095a6130f16f02ca72e09712596e0e48551.zip
Use dependency injection for app manager
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/dav/lib/Connector')
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesReportPlugin.php13
-rw-r--r--apps/dav/lib/Connector/Sabre/ServerFactory.php3
2 files changed, 13 insertions, 3 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
index f4e5de0ea43..6451030c324 100644
--- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
@@ -25,6 +25,7 @@
namespace OCA\DAV\Connector\Sabre;
use OC\Files\View;
+use OCP\App\IAppManager;
use Sabre\DAV\Exception\PreconditionFailed;
use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\ServerPlugin;
@@ -98,6 +99,11 @@ class FilesReportPlugin extends ServerPlugin {
private $userFolder;
/**
+ * @var IAppManager
+ */
+ private $appManager;
+
+ /**
* @param Tree $tree
* @param View $view
* @param ISystemTagManager $tagManager
@@ -106,6 +112,7 @@ class FilesReportPlugin extends ServerPlugin {
* @param IUserSession $userSession
* @param IGroupManager $groupManager
* @param Folder $userFolder
+ * @param IAppManager $appManager
*/
public function __construct(Tree $tree,
View $view,
@@ -114,7 +121,8 @@ class FilesReportPlugin extends ServerPlugin {
ITagManager $fileTagger,
IUserSession $userSession,
IGroupManager $groupManager,
- Folder $userFolder
+ Folder $userFolder,
+ IAppManager $appManager
) {
$this->tree = $tree;
$this->fileView = $view;
@@ -124,6 +132,7 @@ class FilesReportPlugin extends ServerPlugin {
$this->userSession = $userSession;
$this->groupManager = $groupManager;
$this->userFolder = $userFolder;
+ $this->appManager = $appManager;
}
/**
@@ -349,7 +358,7 @@ class FilesReportPlugin extends ServerPlugin {
* @return array
*/
private function getCirclesFileIds(array $circlesIds) {
- if (!\OC::$server->getAppManager()->isEnabledForUser('circles') || !class_exists('\OCA\Circles\ShareByCircleProvider')) {
+ if (!$this->appManager->isEnabledForUser('circles') || !class_exists('\OCA\Circles\ShareByCircleProvider')) {
return array();
}
return \OCA\Circles\Api\v1\Circles::getFilesForCircles($circlesIds);
diff --git a/apps/dav/lib/Connector/Sabre/ServerFactory.php b/apps/dav/lib/Connector/Sabre/ServerFactory.php
index 12b00be43f5..1821638189d 100644
--- a/apps/dav/lib/Connector/Sabre/ServerFactory.php
+++ b/apps/dav/lib/Connector/Sabre/ServerFactory.php
@@ -180,7 +180,8 @@ class ServerFactory {
\OC::$server->getTagManager(),
$this->userSession,
\OC::$server->getGroupManager(),
- $userFolder
+ $userFolder,
+ \OC::$server->getAppManager()
));
// custom properties plugin must be the last one
$server->addPlugin(