diff --git a/core/register_command.php b/core/register_command.php index fa85aea895..89b0cf31ef 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -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())); diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php index a7aae32f67..8a1ed60b25 100644 --- a/lib/private/DB/ConnectionFactory.php +++ b/lib/private/DB/ConnectionFactory.php @@ -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'; } } diff --git a/lib/private/Server.php b/lib/private/Server.php index 063ff4a3d3..11558118d5 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -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'); diff --git a/lib/private/Setup/AbstractDatabase.php b/lib/private/Setup/AbstractDatabase.php index 310f74d4c0..47c3e5ee1c 100644 --- a/lib/private/Setup/AbstractDatabase.php +++ b/lib/private/Setup/AbstractDatabase.php @@ -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); }