Skip to content

Commit 0129c1c

Browse files
juliusknorrbackportbot[bot]
authored andcommitted
Register services during registration instead of boot
This will allow all apps to use a propery setup fulltextsearch manager instance when they try to access it during their own boot method Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent c95441a commit 0129c1c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/AppInfo/Application.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
use OCP\IServerContainer;
4949
use OCP\IURLGenerator;
5050
use Symfony\Component\Routing\Exception\RouteNotFoundException;
51+
use Psr\Container\ContainerInterface;
5152
use Throwable;
5253

5354
require_once __DIR__ . '/../../vendor/autoload.php';
@@ -76,6 +77,7 @@ public function __construct(array $params = []) {
7677
public function register(IRegistrationContext $context): void {
7778
$context->registerCapability(Capabilities::class);
7879
$context->registerSearchProvider(UnifiedSearchProvider::class);
80+
$this->registerServices($this->getContainer());
7981
}
8082

8183
/**
@@ -84,17 +86,16 @@ public function register(IRegistrationContext $context): void {
8486
* @throws Throwable
8587
*/
8688
public function boot(IBootContext $context): void {
87-
$context->injectFn(Closure::fromCallable([$this, 'registerServices']));
8889
$context->injectFn(Closure::fromCallable([$this, 'registerNavigation']));
8990
}
9091

9192

9293
/**
9394
* Register Navigation Tab
9495
*
95-
* @param IServerContainer $container
96+
* @param ContainerInterface $container
9697
*/
97-
protected function registerServices(IServerContainer $container) {
98+
protected function registerServices(ContainerInterface $container) {
9899
/** @var IFullTextSearchManager $fullTextSearchManager */
99100
$fullTextSearchManager = $container->get(IFullTextSearchManager::class);
100101

0 commit comments

Comments
 (0)