diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-21 12:13:01 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-21 12:13:01 +0100 |
commit | 7c7467fe4244cb26a86670bc89194da7b4dc82b5 (patch) | |
tree | 4b4d203386cc9780398e654cafff73c8ab70e938 /lib/private/server.php | |
parent | ec8022d241541b25a0e4d01857bf6a0c1ed74eca (diff) | |
parent | 899f9bd113304d77b865653768450f6013824553 (diff) | |
download | nextcloud-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.php | 13 |
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() { |