Merge pull request #19883 from owncloud/provide-iappcontainer

Provide IAppContainer as dependency injection
This commit is contained in:
Thomas Müller 2015-10-21 10:49:26 +02:00
commit d0aeb268d6
1 changed files with 4 additions and 0 deletions

View File

@ -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');