aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-03-26 15:27:30 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2021-06-16 13:56:25 +0200
commit381aaeb0ccb309a4d29bf32b1fa384617fe1629a (patch)
tree98caa984c4b8db72a73895454e0ec6e4df6b15db /apps/files_external
parent2bb78da8136d46ad743e14d7b1687e4e6d80f7bf (diff)
downloadnextcloud-server-381aaeb0ccb309a4d29bf32b1fa384617fe1629a.tar.gz
nextcloud-server-381aaeb0ccb309a4d29bf32b1fa384617fe1629a.zip
move logic from contstructor to boot method
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/AppInfo/Application.php27
1 files changed, 12 insertions, 15 deletions
diff --git a/apps/files_external/lib/AppInfo/Application.php b/apps/files_external/lib/AppInfo/Application.php
index d70e3018e01..2181a7e2533 100644
--- a/apps/files_external/lib/AppInfo/Application.php
+++ b/apps/files_external/lib/AppInfo/Application.php
@@ -75,6 +75,7 @@ use OCP\IUser;
use OCP\User\Events\UserDeletedEvent;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
+use function foo\func;
require_once __DIR__ . '/../../3rdparty/autoload.php';
@@ -90,20 +91,6 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
*/
public function __construct(array $urlParams = []) {
parent::__construct('files_external', $urlParams);
-
- $container = $this->getContainer();
-
- /** @var BackendService $backendService */
- $backendService = $container->query(BackendService::class);
- $backendService->registerBackendProvider($this);
- $backendService->registerAuthMechanismProvider($this);
- $backendService->registerConfigHandler('user', function () use ($container) {
- return $container->query(UserPlaceholderHandler::class);
- });
-
- // force-load auth mechanisms since some will register hooks
- // TODO: obsolete these and use the TokenProvider to get the user's password from the session
- $this->getAuthMechanisms();
}
public function register(IRegistrationContext $context): void {
@@ -125,7 +112,17 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
'name' => $l->t('External storages'),
];
});
- $context->injectFn([$this, 'registerListeners']);
+ $context->injectFn(function(BackendService $backendService, UserPlaceholderHandler $userConfigHandler) {
+ $backendService->registerBackendProvider($this);
+ $backendService->registerAuthMechanismProvider($this);
+ $backendService->registerConfigHandler('user', function () use ($userConfigHandler) {
+ return $userConfigHandler;
+ });
+ });
+
+ // force-load auth mechanisms since some will register hooks
+ // TODO: obsolete these and use the TokenProvider to get the user's password from the session
+ $this->getAuthMechanisms();
}
/**