diff options
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r-- | lib/private/AppFramework/App.php | 3 | ||||
-rw-r--r-- | lib/private/AppFramework/DependencyInjection/DIContainer.php | 7 | ||||
-rw-r--r-- | lib/private/AppFramework/Utility/SimpleContainer.php | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php index 838710e63d8..7bf32852209 100644 --- a/lib/private/AppFramework/App.php +++ b/lib/private/AppFramework/App.php @@ -138,8 +138,7 @@ class App { $eventLogger->start('app:controller:dispatcher', 'Initialize dispatcher and pre-middleware'); // initialize the dispatcher and run all the middleware before the controller - /** @var Dispatcher $dispatcher */ - $dispatcher = $container['Dispatcher']; + $dispatcher = $container->get(Dispatcher::class); $eventLogger->end('app:controller:dispatcher'); diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 5ccc1b7d348..76261fe6b92 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -38,6 +38,7 @@ use OC\Log\PsrLoggerAdapter; use OC\ServerContainer; use OC\Settings\AuthorizedGroupMapper; use OCA\WorkflowEngine\Manager; +use OCP\App\IAppManager; use OCP\AppFramework\Http\IOutput; use OCP\AppFramework\IAppContainer; use OCP\AppFramework\QueryException; @@ -63,7 +64,7 @@ use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; class DIContainer extends SimpleContainer implements IAppContainer { - private string $appName; + protected string $appName; private array $middleWares = []; private ServerContainer $server; @@ -152,7 +153,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { $this->registerDeprecatedAlias('Dispatcher', Dispatcher::class); $this->registerService(Dispatcher::class, function (ContainerInterface $c) { return new Dispatcher( - $c->get('Protocol'), + $c->get(Http::class), $c->get(MiddlewareDispatcher::class), $c->get(IControllerMethodReflector::class), $c->get(IRequest::class), @@ -200,7 +201,7 @@ class DIContainer extends SimpleContainer implements IAppContainer { $server->getUserSession()->isLoggedIn(), $c->get(IGroupManager::class), $c->get(ISubAdmin::class), - $server->getAppManager(), + $c->get(IAppManager::class), $server->getL10N('lib'), $c->get(AuthorizedGroupMapper::class), $c->get(IUserSession::class), diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php index ed26e75ec89..0db3bfc1c77 100644 --- a/lib/private/AppFramework/Utility/SimpleContainer.php +++ b/lib/private/AppFramework/Utility/SimpleContainer.php @@ -196,7 +196,9 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer { $this->registerService($alias, function (ContainerInterface $container) use ($target, $alias): mixed { try { $logger = $container->get(LoggerInterface::class); - $logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); + $logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', [ + 'app' => $this->appName ?? 'serverDI', + ]); } catch (ContainerExceptionInterface $e) { // Could not get logger. Continue } |