mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 08:25:56 -04:00
avoid early DI of IAppManager
- might break install Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
8c87c0bb28
commit
5c757f31e1
1 changed files with 7 additions and 4 deletions
|
|
@ -31,7 +31,8 @@ use OCP\App\IAppManager;
|
|||
use OCP\Dashboard\IManager;
|
||||
use OCP\Dashboard\IWidget;
|
||||
use OCP\ILogger;
|
||||
use OCP\IServerContainer;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Throwable;
|
||||
|
||||
class Manager implements IManager {
|
||||
|
|
@ -43,11 +44,10 @@ class Manager implements IManager {
|
|||
private $widgets = [];
|
||||
|
||||
private ContainerInterface $serverContainer;
|
||||
private IAppManager $appManager;
|
||||
private ?IAppManager $appManager = null;
|
||||
|
||||
public function __construct(ContainerInterface $serverContainer, IAppManager $appManager) {
|
||||
public function __construct(ContainerInterface $serverContainer) {
|
||||
$this->serverContainer = $serverContainer;
|
||||
$this->appManager = $appManager;
|
||||
}
|
||||
|
||||
private function registerWidget(IWidget $widget): void {
|
||||
|
|
@ -63,6 +63,9 @@ class Manager implements IManager {
|
|||
}
|
||||
|
||||
public function loadLazyPanels(): void {
|
||||
if ($this->appManager === null) {
|
||||
$this->appManager = $this->serverContainer->get(IAppManager::class);
|
||||
}
|
||||
$services = $this->lazyWidgets;
|
||||
foreach ($services as $service) {
|
||||
/** @psalm-suppress InvalidCatch */
|
||||
|
|
|
|||
Loading…
Reference in a new issue