Inject file boot services directly

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2021-04-23 16:07:04 +02:00
parent 4845834468
commit 06a4cf59b2
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
1 changed files with 10 additions and 5 deletions

View File

@ -64,6 +64,7 @@ use OCP\IUserSession;
use OCP\Share\IManager as IShareManager;
use OCP\Util;
use Psr\Container\ContainerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class Application extends App implements IBootstrap {
public const APP_ID = 'files';
@ -121,12 +122,16 @@ class Application extends App implements IBootstrap {
$context->registerNotifierService(Notifier::class);
}
public function boot(IBootContext $context): void {
$context->injectFn(Closure::fromCallable([$this, 'registerCollaboration']));
$context->injectFn([Listener::class, 'register']);
$context->injectFn(Closure::fromCallable([$this, 'registerSearchProvider']));
public function boot(IBootContext $context,
IProviderManager $providerManager,
EventDispatcherInterface $dispatcher,
ISearch $search,
IL10N $l10n): void {
$this->registerCollaboration($providerManager);
Listener::register($dispatcher);
$this->registerSearchProvider($search);
$this->registerTemplates();
$context->injectFn(Closure::fromCallable([$this, 'registerNavigation']));
$this->registerNavigation($l10n);
$this->registerHooks();
}