diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-05-12 00:12:19 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-05-12 00:12:19 +0200 |
commit | 7a6ff56b138f1b7d5f1db49855e5069cc241b052 (patch) | |
tree | be330362388816aa565647825b308c0c034474f3 /lib/private/server.php | |
parent | 58dc10349aed7cb7ad635a50ef0a16f1db1ae5a0 (diff) | |
parent | 3af30625ab05f0a793ddc6e9053c79dbdcc23c2a (diff) | |
download | nextcloud-server-7a6ff56b138f1b7d5f1db49855e5069cc241b052.tar.gz nextcloud-server-7a6ff56b138f1b7d5f1db49855e5069cc241b052.zip |
Merge pull request #8274 from owncloud/appframework-db
Port database layer from appframework to core
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 4c29092cf44..27763ea6477 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(); + }); } /** @@ -400,4 +404,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'); + } } |