aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/server.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-21 12:13:01 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-21 12:13:01 +0100
commit7c7467fe4244cb26a86670bc89194da7b4dc82b5 (patch)
tree4b4d203386cc9780398e654cafff73c8ab70e938 /lib/private/server.php
parentec8022d241541b25a0e4d01857bf6a0c1ed74eca (diff)
parent899f9bd113304d77b865653768450f6013824553 (diff)
downloadnextcloud-server-7c7467fe4244cb26a86670bc89194da7b4dc82b5.tar.gz
nextcloud-server-7c7467fe4244cb26a86670bc89194da7b4dc82b5.zip
Merge pull request #21792 from owncloud/systemtags-managerfactory
Allow custom implementation of system tag managers
Diffstat (limited to 'lib/private/server.php')
-rw-r--r--lib/private/server.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/private/server.php b/lib/private/server.php
index db36fbc1433..a16e6b9839b 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -143,11 +143,18 @@ class Server extends ServerContainer implements IServerContainer {
$tagMapper = $c->query('TagMapper');
return new TagManager($tagMapper, $c->getUserSession());
});
+ $this->registerService('SystemTagManagerFactory', function (Server $c) {
+ $config = $c->getConfig();
+ $factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory');
+ /** @var \OC\SystemTag\ManagerFactory $factory */
+ $factory = new $factoryClass($this);
+ return $factory;
+ });
$this->registerService('SystemTagManager', function (Server $c) {
- return new SystemTag\SystemTagManager($c->getDatabaseConnection());
+ return $c->query('SystemTagManagerFactory')->getManager();
});
$this->registerService('SystemTagObjectMapper', function (Server $c) {
- return new SystemTag\SystemTagObjectMapper($c->getDatabaseConnection(), $c->getSystemTagManager());
+ return $c->query('SystemTagManagerFactory')->getObjectMapper();
});
$this->registerService('RootFolder', function (Server $c) {
// TODO: get user and user manager from container as well
@@ -537,7 +544,7 @@ class Server extends ServerContainer implements IServerContainer {
$config = $c->getConfig();
$factoryClass = $config->getSystemValue('comments.managerFactory', '\OC\Comments\ManagerFactory');
/** @var \OCP\Comments\ICommentsManagerFactory $factory */
- $factory = new $factoryClass();
+ $factory = new $factoryClass($this);
return $factory->getManager();
});
$this->registerService('EventDispatcher', function() {