diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-19 19:30:12 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-19 19:30:12 +0200 |
commit | 4a7e0561caebd470fbaaf88655619930260a573e (patch) | |
tree | df8451dc9126c574144b4f907840899d16c62fca /lib/private/server.php | |
parent | 0fe4db099265c7e7a9f4be2c98bb3d9329670286 (diff) | |
download | nextcloud-server-4a7e0561caebd470fbaaf88655619930260a573e.tar.gz nextcloud-server-4a7e0561caebd470fbaaf88655619930260a573e.zip |
move db into iservercontainer
Diffstat (limited to 'lib/private/server.php')
-rw-r--r-- | lib/private/server.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/server.php b/lib/private/server.php index 5d90a0b19fc..e977c643832 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -3,6 +3,7 @@ namespace OC; use OC\AppFramework\Http\Request; +use OC\AppFramework\Db\Db; use OC\AppFramework\Utility\SimpleContainer; use OC\Cache\UserCache; use OC\DB\ConnectionWrapper; @@ -177,6 +178,9 @@ class Server extends SimpleContainer implements IServerContainer { } return $router; }); + $this['Db'] = $this->share(function($c){ + return new Db(); + }); } /** @@ -392,4 +396,13 @@ class Server extends SimpleContainer implements IServerContainer { function getRouter(){ return $this->query('Router'); } + + + /** + * Returns an instance of the db facade + * @return \OCP\IDb + */ + function getDb() { + return $this->query('Db'); + } } |