PoC of moving the interface classes to the servercontainer
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
886202123c
commit
df14684817
|
@ -82,10 +82,6 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
/**
|
||||
* Core services
|
||||
*/
|
||||
$this->registerService('OCP\\IAppConfig', function($c) {
|
||||
return $this->getServer()->getAppConfig();
|
||||
});
|
||||
|
||||
$this->registerService('OCP\\App\\IAppManager', function($c) {
|
||||
return $this->getServer()->getAppManager();
|
||||
});
|
||||
|
@ -125,10 +121,6 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
return $this->getServer()->getCommentsManager();
|
||||
});
|
||||
|
||||
$this->registerService('OCP\\IConfig', function($c) {
|
||||
return $this->getServer()->getConfig();
|
||||
});
|
||||
|
||||
$this->registerService('OCP\\Contacts\\IManager', function($c) {
|
||||
return $this->getServer()->getContactsManager();
|
||||
});
|
||||
|
|
|
@ -338,17 +338,25 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
$c->getUserSession(),
|
||||
$c->getGroupManager());
|
||||
});
|
||||
$this->registerService('AllConfig', function (Server $c) {
|
||||
|
||||
$this->registerService(\OC\AllConfig::class, function (Server $c) {
|
||||
return new \OC\AllConfig(
|
||||
$c->getSystemConfig()
|
||||
);
|
||||
});
|
||||
$this->registerAlias('AllConfig', \OC\AllConfig::class);
|
||||
$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
|
||||
|
||||
$this->registerService('SystemConfig', function ($c) use ($config) {
|
||||
return new \OC\SystemConfig($config);
|
||||
});
|
||||
$this->registerService('AppConfig', function (Server $c) {
|
||||
|
||||
$this->registerService(\OC\AppConfig::class, function (Server $c) {
|
||||
return new \OC\AppConfig($c->getDatabaseConnection());
|
||||
});
|
||||
$this->registerAlias('AppConfig', \OC\AppConfig::class);
|
||||
$this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class);
|
||||
|
||||
$this->registerService('L10NFactory', function (Server $c) {
|
||||
return new \OC\L10N\Factory(
|
||||
$c->getConfig(),
|
||||
|
|
Loading…
Reference in New Issue