mirror of
https://github.com/nextcloud/server.git
synced 2026-03-05 06:50:55 -05:00
Merge pull request #19883 from owncloud/provide-iappcontainer
Provide IAppContainer as dependency injection
This commit is contained in:
commit
d0aeb268d6
1 changed files with 4 additions and 0 deletions
|
|
@ -226,6 +226,10 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
return $this->getServer();
|
||||
});
|
||||
|
||||
$this->registerService('OCP\\AppFramework\\IAppContainer', function ($c) {
|
||||
return $c;
|
||||
});
|
||||
|
||||
// commonly used attributes
|
||||
$this->registerService('UserId', function ($c) {
|
||||
return $c->query('OCP\\IUserSession')->getSession()->get('user_id');
|
||||
|
|
|
|||
Loading…
Reference in a new issue