diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2021-08-10 15:33:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-10 15:33:56 +0300 |
commit | b3738c222560cd473f54618329119d667698194e (patch) | |
tree | 85ff88450c3ef0c26cbb73c347d6c2e4e14f5523 | |
parent | 77413a487ed0e046111dfbcf0222650e03a75dd9 (diff) | |
parent | 0129c1ce770e2bc76c028e85694a11edc3627363 (diff) |
Merge pull request #651 from nextcloud/backport/619/stable21
[stable21] Register services during registration instead of boot
-rw-r--r-- | lib/AppInfo/Application.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 794ecde..bcbb084 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -48,6 +48,7 @@ use OCP\INavigationManager; use OCP\IServerContainer; use OCP\IURLGenerator; use Symfony\Component\Routing\Exception\RouteNotFoundException; +use Psr\Container\ContainerInterface; use Throwable; require_once __DIR__ . '/../../vendor/autoload.php'; @@ -76,6 +77,7 @@ class Application extends App implements IBootstrap { public function register(IRegistrationContext $context): void { $context->registerCapability(Capabilities::class); $context->registerSearchProvider(UnifiedSearchProvider::class); + $this->registerServices($this->getContainer()); } /** @@ -84,7 +86,6 @@ class Application extends App implements IBootstrap { * @throws Throwable */ public function boot(IBootContext $context): void { - $context->injectFn(Closure::fromCallable([$this, 'registerServices'])); $context->injectFn(Closure::fromCallable([$this, 'registerNavigation'])); } @@ -92,9 +93,9 @@ class Application extends App implements IBootstrap { /** * Register Navigation Tab * - * @param IServerContainer $container + * @param ContainerInterface $container */ - protected function registerServices(IServerContainer $container) { + protected function registerServices(ContainerInterface $container) { /** @var IFullTextSearchManager $fullTextSearchManager */ $fullTextSearchManager = $container->get(IFullTextSearchManager::class); |