Thomas Müller
10 years ago
committed by
Morris Jobke
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
4 changed files with
6 additions and
6 deletions
-
core/register_command.php
-
lib/private/DB/ConnectionFactory.php
-
lib/private/Server.php
-
lib/private/Setup/AbstractDatabase.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())); |
|
|
|
|
|
|
|
@ -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); |
|
|
|
} |
|
|
|
|
|
|
|
|