summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-04-15 14:06:23 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2020-04-18 11:21:28 +0200
commite45c87cd2e7cb6c818f7a99b51afd1f16606f930 (patch)
tree3ba620c6a33ab546e890366683eb15f76a0023ed /apps/files_sharing
parent708b4991d9039543130b569dd845ed8d8cd1a68c (diff)
downloadnextcloud-server-e45c87cd2e7cb6c818f7a99b51afd1f16606f930.tar.gz
nextcloud-server-e45c87cd2e7cb6c818f7a99b51afd1f16606f930.zip
Fix creating the share controller
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php73
1 files changed, 3 insertions, 70 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index 34db7441daa..23db5e3ce32 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -81,47 +81,9 @@ class Application extends App {
$notifications = $server->getNotificationManager();
/**
- * Controllers
- */
- $container->registerService('ShareController', function (SimpleContainer $c) use ($server) {
- $federatedSharingApp = new \OCA\FederatedFileSharing\AppInfo\Application();
- return new ShareController(
- $c->query('AppName'),
- $c->query('Request'),
- $server->getConfig(),
- $server->getURLGenerator(),
- $server->getUserManager(),
- $server->getLogger(),
- $server->getActivityManager(),
- $server->getShareManager(),
- $server->getSession(),
- $server->getPreviewManager(),
- $server->getRootFolder(),
- $federatedSharingApp->getFederatedShareProvider(),
- $server->getEventDispatcher(),
- $server->getL10N($c->query('AppName')),
- $server->query(Defaults::class)
- );
- });
- $container->registerService('ExternalSharesController', function (SimpleContainer $c) {
- return new ExternalSharesController(
- $c->query('AppName'),
- $c->query('Request'),
- $c->query('ExternalManager'),
- $c->query('HttpClientService')
- );
- });
-
- /**
* Core class wrappers
*/
- $container->registerService('HttpClientService', function (SimpleContainer $c) use ($server) {
- return $server->getHTTPClientService();
- });
- $container->registerService(ICloudIdManager::class, function (SimpleContainer $c) use ($server) {
- return $server->getCloudIdManager();
- });
- $container->registerService('ExternalManager', function (SimpleContainer $c) use ($server) {
+ $container->registerService(Manager::class, function (SimpleContainer $c) use ($server) {
$user = $server->getUserSession()->getUser();
$uid = $user ? $user->getUID() : null;
return new \OCA\Files_Sharing\External\Manager(
@@ -138,43 +100,14 @@ class Application extends App {
$uid
);
});
- $container->registerAlias(Manager::class, 'ExternalManager');
/**
* Middleware
*/
- $container->registerService('SharingCheckMiddleware', function (SimpleContainer $c) use ($server) {
- return new SharingCheckMiddleware(
- $c->query('AppName'),
- $server->getConfig(),
- $server->getAppManager(),
- $server->query(IControllerMethodReflector::class),
- $server->getShareManager(),
- $server->getRequest()
- );
- });
-
- $container->registerService(ShareInfoMiddleware::class, function () use ($server) {
- return new ShareInfoMiddleware(
- $server->getShareManager()
- );
- });
-
- // Execute middlewares
- $container->registerMiddleWare('SharingCheckMiddleware');
+ $container->registerMiddleWare(SharingCheckMiddleware::class);
$container->registerMiddleWare(OCSShareAPIMiddleware::class);
$container->registerMiddleWare(ShareInfoMiddleware::class);
- $container->registerService('MountProvider', function (IContainer $c) {
- /** @var \OCP\IServerContainer $server */
- $server = $c->query('ServerContainer');
- return new MountProvider(
- $server->getConfig(),
- $server->getShareManager(),
- $server->getLogger()
- );
- });
-
$container->registerService('ExternalMountProvider', function (IContainer $c) {
/** @var \OCP\IServerContainer $server */
$server = $c->query('ServerContainer');
@@ -205,7 +138,7 @@ class Application extends App {
}
protected function registerMountProviders(IMountProviderCollection $mountProviderCollection) {
- $mountProviderCollection->registerProvider($this->getContainer()->query('MountProvider'));
+ $mountProviderCollection->registerProvider($this->getContainer()->query(MountProvider::class));
$mountProviderCollection->registerProvider($this->getContainer()->query('ExternalMountProvider'));
}