summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/appframework/db/db.php2
-rw-r--r--lib/private/appframework/dependencyinjection/dicontainer.php7
-rw-r--r--lib/private/server.php13
3 files changed, 14 insertions, 8 deletions
diff --git a/lib/private/appframework/db/db.php b/lib/private/appframework/db/db.php
index 713b39175c6..fc77a38f814 100644
--- a/lib/private/appframework/db/db.php
+++ b/lib/private/appframework/db/db.php
@@ -23,7 +23,7 @@
namespace OC\AppFramework\Db;
-use \OCP\AppFramework\Db\IDb;
+use \OCP\IDb;
/**
diff --git a/lib/private/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php
index 0faa507c76e..73d356e9852 100644
--- a/lib/private/appframework/dependencyinjection/dicontainer.php
+++ b/lib/private/appframework/dependencyinjection/dicontainer.php
@@ -62,13 +62,6 @@ class DIContainer extends SimpleContainer implements IAppContainer{
});
/**
- * Database
- */
- $this['Db'] = $this->share(function($c){
- return new Db();
- });
-
- /**
* Http
*/
$this['Request'] = $this->share(function($c) {
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');
+ }
}