Fixing ctor call
This commit is contained in:
parent
296a3274cf
commit
a7245ea082
4 changed files with 6 additions and 6 deletions
|
@ -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()));
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue