Add for proper DI

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2016-09-08 15:20:39 +02:00
parent 92dc9e6899
commit 3260f69590
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
1 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,7 @@ use OC\AppFramework\Utility\SimpleContainer;
use OC\Core\Middleware\TwoFactorMiddleware;
use OCP\AppFramework\IApi;
use OCP\AppFramework\IAppContainer;
use OCP\Files\IAppData;
class DIContainer extends SimpleContainer implements IAppContainer {
@ -164,6 +165,10 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $this->getServer()->getHTTPClientService();
});
$this->registerService(IAppData::class, function (SimpleContainer $c) {
return $this->getServer()->getAppDataDir($c->query('AppName'));
});
$this->registerService('OCP\\IGroupManager', function($c) {
return $this->getServer()->getGroupManager();
});