Fixing ctor call

This commit is contained in:
Thomas Müller 2016-02-09 17:25:12 +01:00 committed by Morris Jobke
parent 296a3274cf
commit a7245ea082
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
4 changed files with 6 additions and 6 deletions

View File

@ -83,7 +83,7 @@ if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
$application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
$application->add(new OC\Core\Command\Db\GenerateChangeScript());
$application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getSystemConfig())));
$application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getConfig())));
$application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
$application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));

View File

@ -28,7 +28,7 @@ namespace OC\DB;
use Doctrine\DBAL\Event\Listeners\OracleSessionInit;
use Doctrine\DBAL\Event\Listeners\SQLSessionInit;
use Doctrine\DBAL\Event\Listeners\MysqlSessionInit;
use OC\SystemConfig;
use OCP\IConfig;
/**
* Takes care of creating and configuring Doctrine connections.
@ -65,8 +65,8 @@ class ConnectionFactory {
),
);
public function __construct(SystemConfig $systemConfig) {
if($systemConfig->getValue('mysql.utf8mb4', false)) {
public function __construct(IConfig $config) {
if($config->getSystemValue('mysql.utf8mb4', false)) {
$defaultConnectionParams['mysql']['charset'] = 'utf8mb4';
}
}

View File

@ -408,7 +408,7 @@ class Server extends ServerContainer implements IServerContainer {
});
$this->registerService('DatabaseConnection', function (Server $c) {
$systemConfig = $c->getSystemConfig();
$factory = new \OC\DB\ConnectionFactory($systemConfig);
$factory = new \OC\DB\ConnectionFactory($c->getConfig());
$type = $systemConfig->getValue('dbtype', 'sqlite');
if (!$factory->isValidType($type)) {
throw new \OC\DatabaseException('Invalid database type');

View File

@ -134,7 +134,7 @@ abstract class AbstractDatabase {
}
$connectionParams = array_merge($connectionParams, $configOverwrite);
$cf = new ConnectionFactory();
$cf = new ConnectionFactory($this->config);
return $cf->getConnection($this->config->getSystemValue('dbtype', 'sqlite'), $connectionParams);
}