Skip to content

Commit

Permalink
Merge pull request #651 from nextcloud/backport/619/stable21
Browse files Browse the repository at this point in the history
[stable21] Register services during registration instead of boot
  • Loading branch information
ArtificialOwl authored Aug 10, 2021
2 parents 77413a4 + 0129c1c commit b3738c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
use OCP\IServerContainer;
use OCP\IURLGenerator;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Psr\Container\ContainerInterface;
use Throwable;

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

/**
Expand All @@ -84,17 +86,16 @@ public function register(IRegistrationContext $context): void {
* @throws Throwable
*/
public function boot(IBootContext $context): void {
$context->injectFn(Closure::fromCallable([$this, 'registerServices']));
$context->injectFn(Closure::fromCallable([$this, 'registerNavigation']));
}


/**
* 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);

Expand Down

0 comments on commit b3738c2

Please sign in to comment.