summaryrefslogtreecommitdiffstats
path: root/lib/private/DB
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-03-21 16:08:05 -0600
committerMorris Jobke <hey@morrisjobke.de>2017-03-21 16:42:42 -0600
commit3329f44a76f960f7b73beb6bb4d717b10bfca28b (patch)
treebf915423161beb188c40928b0bbe25d82c57ed5d /lib/private/DB
parent1aef2f417b2004ee23c3071917e699e66b5353dd (diff)
downloadnextcloud-server-3329f44a76f960f7b73beb6bb4d717b10bfca28b.tar.gz
nextcloud-server-3329f44a76f960f7b73beb6bb4d717b10bfca28b.zip
Address comments
* fix URL to documentation * improve logic of UTF8mb4 check * fix connection parameter creation - it's done already in ConnectionFactory::createConnectionParams * remove unused attributes of MDB2SchemaReader Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/DB')
-rw-r--r--lib/private/DB/Connection.php5
-rw-r--r--lib/private/DB/MDB2SchemaReader.php17
2 files changed, 1 insertions, 21 deletions
diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php
index 0ee58a54ece..9e116712642 100644
--- a/lib/private/DB/Connection.php
+++ b/lib/private/DB/Connection.php
@@ -419,9 +419,6 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection {
if (!$this->getDatabasePlatform() instanceof MySqlPlatform) {
return true;
}
- if ($this->getParams()['charset'] === 'utf8mb4') {
- return true;
- }
- return false;
+ return $this->getParams()['charset'] === 'utf8mb4';
}
}
diff --git a/lib/private/DB/MDB2SchemaReader.php b/lib/private/DB/MDB2SchemaReader.php
index dc067b43c4a..9495160b52f 100644
--- a/lib/private/DB/MDB2SchemaReader.php
+++ b/lib/private/DB/MDB2SchemaReader.php
@@ -38,10 +38,6 @@ use Doctrine\DBAL\Schema\Schema;
use OCP\IConfig;
class MDB2SchemaReader {
- /**
- * @var string $DBNAME
- */
- protected $DBNAME;
/**
* @var string $DBTABLEPREFIX
@@ -53,9 +49,6 @@ class MDB2SchemaReader {
*/
protected $platform;
- /** @var \Doctrine\DBAL\Schema\SchemaConfig $schemaConfig */
- protected $schemaConfig;
-
/** @var IConfig */
protected $config;
@@ -66,7 +59,6 @@ class MDB2SchemaReader {
public function __construct(IConfig $config, AbstractPlatform $platform) {
$this->platform = $platform;
$this->config = $config;
- $this->DBNAME = $config->getSystemValue('dbname', 'owncloud');
$this->DBTABLEPREFIX = $config->getSystemValue('dbtableprefix', 'oc_');
}
@@ -118,15 +110,6 @@ class MDB2SchemaReader {
$name = str_replace('*dbprefix*', $this->DBTABLEPREFIX, $name);
$name = $this->platform->quoteIdentifier($name);
$table = $schema->createTable($name);
- $table->setSchemaConfig($this->schemaConfig);
-
- if($this->platform instanceof MySqlPlatform && $this->config->getSystemValue('mysql.utf8mb4', false)) {
- $table->addOption('charset', 'utf8mb4');
- $table->addOption('collate', 'utf8mb4_bin');
- $table->addOption('row_format', 'compressed');
- } else {
- $table->addOption('collate', 'utf8_bin');
- }
break;
case 'create':
case 'overwrite':