summaryrefslogtreecommitdiffstats
path: root/lib/private/db
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-11-19 00:25:26 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-11-20 15:03:16 +0100
commit8ae8eb47349f2510976637c6a1e8fa91e8d9f8d3 (patch)
tree510f7823369a233e5b8eef4b65168b5cd14f08a3 /lib/private/db
parentcbb9caf03083cc083491e292143ee53871920106 (diff)
downloadnextcloud-server-8ae8eb47349f2510976637c6a1e8fa91e8d9f8d3.tar.gz
nextcloud-server-8ae8eb47349f2510976637c6a1e8fa91e8d9f8d3.zip
drop dependency of some commands on old config object
Diffstat (limited to 'lib/private/db')
-rw-r--r--lib/private/db/mdb2schemamanager.php6
-rw-r--r--lib/private/db/mdb2schemareader.php11
2 files changed, 10 insertions, 7 deletions
diff --git a/lib/private/db/mdb2schemamanager.php b/lib/private/db/mdb2schemamanager.php
index 632e320576c..78267094d0e 100644
--- a/lib/private/db/mdb2schemamanager.php
+++ b/lib/private/db/mdb2schemamanager.php
@@ -49,7 +49,7 @@ class MDB2SchemaManager {
* TODO: write more documentation
*/
public function createDbFromStructure($file) {
- $schemaReader = new MDB2SchemaReader(\OC_Config::getObject(), $this->conn->getDatabasePlatform());
+ $schemaReader = new MDB2SchemaReader(\OC::$server->getConfig(), $this->conn->getDatabasePlatform());
$toSchema = $schemaReader->loadSchemaFromFile($file);
return $this->executeSchemaChange($toSchema);
}
@@ -83,7 +83,7 @@ class MDB2SchemaManager {
*/
private function readSchemaFromFile($file) {
$platform = $this->conn->getDatabasePlatform();
- $schemaReader = new MDB2SchemaReader(\OC_Config::getObject(), $platform);
+ $schemaReader = new MDB2SchemaReader(\OC::$server->getConfig(), $platform);
return $schemaReader->loadSchemaFromFile($file);
}
@@ -131,7 +131,7 @@ class MDB2SchemaManager {
* @param string $file the xml file describing the tables
*/
public function removeDBStructure($file) {
- $schemaReader = new MDB2SchemaReader(\OC_Config::getObject(), $this->conn->getDatabasePlatform());
+ $schemaReader = new MDB2SchemaReader(\OC::$server->getConfig(), $this->conn->getDatabasePlatform());
$fromSchema = $schemaReader->loadSchemaFromFile($file);
$toSchema = clone $fromSchema;
/** @var $table \Doctrine\DBAL\Schema\Table */
diff --git a/lib/private/db/mdb2schemareader.php b/lib/private/db/mdb2schemareader.php
index 288eef5cda0..7dd4168fb6e 100644
--- a/lib/private/db/mdb2schemareader.php
+++ b/lib/private/db/mdb2schemareader.php
@@ -8,6 +8,9 @@
namespace OC\DB;
+use Doctrine\DBAL\Platforms\AbstractPlatform;
+use OCP\IConfig;
+
class MDB2SchemaReader {
/**
* @var string $DBNAME
@@ -25,13 +28,13 @@ class MDB2SchemaReader {
protected $platform;
/**
- * @param \OC\Config $config
+ * @param \OCP\IConfig $config
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
*/
- public function __construct($config, $platform) {
+ public function __construct(IConfig $config, AbstractPlatform $platform) {
$this->platform = $platform;
- $this->DBNAME = $config->getValue('dbname', 'owncloud');
- $this->DBTABLEPREFIX = $config->getValue('dbtableprefix', 'oc_');
+ $this->DBNAME = $config->getSystemValue('dbname', 'owncloud');
+ $this->DBTABLEPREFIX = $config->getSystemValue('dbtableprefix', 'oc_');
}
/**