summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-14 17:07:38 +0200
committerGitHub <noreply@github.com>2020-07-14 17:07:38 +0200
commit157c6527625cbe90649e32fe1b5dd99771e7541d (patch)
tree1f3dc67e7a58ade763821ef229967d96088d185c /lib
parentfba64a972f3d0be164d185d2770e2223f1bb8a39 (diff)
parentfa9dfd83c97e7b97c78003f40667e3e25db27400 (diff)
downloadnextcloud-server-157c6527625cbe90649e32fe1b5dd99771e7541d.tar.gz
nextcloud-server-157c6527625cbe90649e32fe1b5dd99771e7541d.zip
Merge pull request #21825 from nextcloud/fix/appframework/services
Fix AppFramework services
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 82a2780eb27..bda014838ed 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -59,6 +59,8 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\Folder;
use OCP\Files\IAppData;
use OCP\Group\ISubAdmin;
+use OCP\IConfig;
+use OCP\IInitialStateService;
use OCP\IL10N;
use OCP\ILogger;
use OCP\INavigationManager;
@@ -295,8 +297,18 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $dispatcher;
});
- $this->registerAlias(IAppConfig::class, OC\AppFramework\Services\AppConfig::class);
- $this->registerAlias(IInitialState::class, OC\AppFramework\Services\InitialState::class);
+ $this->registerService(IAppConfig::class, function (SimpleContainer $c) {
+ return new OC\AppFramework\Services\AppConfig(
+ $c->query(IConfig::class),
+ $c->query('AppName')
+ );
+ });
+ $this->registerService(IInitialState::class, function (SimpleContainer $c) {
+ return new OC\AppFramework\Services\InitialState(
+ $c->query(IInitialStateService::class),
+ $c->query('AppName')
+ );
+ });
}
/**