summaryrefslogtreecommitdiffstats
path: root/lib/private/db
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-11-27 16:40:12 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-12-08 22:29:42 +0100
commit50c2a819a0c5ae50571d36a3e2dec4e8267fd13b (patch)
treec6241e94b567618b9f6e7952f45a3aaa11250d49 /lib/private/db
parentf219f5a7a62fe88b364b9a5f50e9730eba1ee84c (diff)
downloadnextcloud-server-50c2a819a0c5ae50571d36a3e2dec4e8267fd13b.tar.gz
nextcloud-server-50c2a819a0c5ae50571d36a3e2dec4e8267fd13b.zip
Extract interaction with config.php into SystemConfig
* introduce SystemConfig to avoid DI circle (used by database connection which is itself needed by AllConfig that itself contains the methods to access the config.php which then would need the database connection - did you get it? ;)) * use DI container and use that method in legacy code paths (for easier refactoring later) * create and use getSystemConfig instead of query() in DI container
Diffstat (limited to 'lib/private/db')
-rw-r--r--lib/private/db/connectionfactory.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/private/db/connectionfactory.php b/lib/private/db/connectionfactory.php
index 58043b30440..9c75baf887d 100644
--- a/lib/private/db/connectionfactory.php
+++ b/lib/private/db/connectionfactory.php
@@ -123,23 +123,23 @@ class ConnectionFactory {
/**
* Create the connection parameters for the config
*
- * @param \OCP\IConfig $config
+ * @param \OC\SystemConfig $config
* @return array
*/
public function createConnectionParams($config) {
- $type = $config->getSystemValue('dbtype', 'sqlite');
+ $type = $config->getValue('dbtype', 'sqlite');
$connectionParams = array(
- 'user' => $config->getSystemValue('dbuser', ''),
- 'password' => $config->getSystemValue('dbpassword', ''),
+ 'user' => $config->getValue('dbuser', ''),
+ 'password' => $config->getValue('dbpassword', ''),
);
- $name = $config->getSystemValue('dbname', 'owncloud');
+ $name = $config->getValue('dbname', 'owncloud');
if ($this->normalizeType($type) === 'sqlite3') {
- $datadir = $config->getSystemValue("datadirectory", \OC::$SERVERROOT . '/data');
+ $datadir = $config->getValue("datadirectory", \OC::$SERVERROOT . '/data');
$connectionParams['path'] = $datadir . '/' . $name . '.db';
} else {
- $host = $config->getSystemValue('dbhost', '');
+ $host = $config->getValue('dbhost', '');
if (strpos($host, ':')) {
// Host variable may carry a port or socket.
list($host, $portOrSocket) = explode(':', $host, 2);
@@ -153,11 +153,11 @@ class ConnectionFactory {
$connectionParams['dbname'] = $name;
}
- $connectionParams['tablePrefix'] = $config->getSystemValue('dbtableprefix', 'oc_');
- $connectionParams['sqlite.journal_mode'] = $config->getSystemValue('sqlite.journal_mode', 'WAL');
+ $connectionParams['tablePrefix'] = $config->getValue('dbtableprefix', 'oc_');
+ $connectionParams['sqlite.journal_mode'] = $config->getValue('sqlite.journal_mode', 'WAL');
//additional driver options, eg. for mysql ssl
- $driverOptions = $config->getSystemValue('dbdriveroptions', null);
+ $driverOptions = $config->getValue('dbdriveroptions', null);
if ($driverOptions) {
$connectionParams['driverOptions'] = $driverOptions;
}