diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-05-08 12:18:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-08 12:18:40 +0200 |
commit | 4d101ca2bec2f8b799535b35188755dbb01e9641 (patch) | |
tree | 93463513a8a0b9ae976cc3561627052cded91819 /core | |
parent | 7cc750fe376a0b676818d06ec00837f655f4a51e (diff) | |
parent | 3afad7fe407ad6c5ef772d0e89f3f3cc06111a36 (diff) | |
download | nextcloud-server-4d101ca2bec2f8b799535b35188755dbb01e9641.tar.gz nextcloud-server-4d101ca2bec2f8b799535b35188755dbb01e9641.zip |
Merge pull request #4514 from nextcloud/automatic-mysql-4byte-detection
Automatic mysql 4byte detection
Diffstat (limited to 'core')
-rw-r--r-- | core/Command/Db/ConvertMysqlToMB4.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/Command/Db/ConvertMysqlToMB4.php b/core/Command/Db/ConvertMysqlToMB4.php index 286274753ee..38aff8b09d8 100644 --- a/core/Command/Db/ConvertMysqlToMB4.php +++ b/core/Command/Db/ConvertMysqlToMB4.php @@ -22,6 +22,7 @@ namespace OC\Core\Command\Db; use Doctrine\DBAL\Platforms\MySqlPlatform; +use OC\DB\MySqlTools; use OC\Migration\ConsoleOutput; use OC\Repair\Collation; use OCP\IConfig; @@ -71,18 +72,17 @@ class ConvertMysqlToMB4 extends Command { return 1; } - $oldValue = $this->config->getSystemValue('mysql.utf8mb4', false); - // enable charset - $this->config->setSystemValue('mysql.utf8mb4', true); - - if (!$this->connection->supports4ByteText()) { + $tools = new MySqlTools(); + if (!$tools->supports4ByteCharset($this->connection)) { $url = $this->urlGenerator->linkToDocs('admin-mysql-utf8mb4'); $output->writeln("The database is not properly setup to use the charset utf8mb4."); $output->writeln("For more information please read the documentation at $url"); - $this->config->setSystemValue('mysql.utf8mb4', $oldValue); return 1; } + // enable charset + $this->config->setSystemValue('mysql.utf8mb4', true); + // run conversion $coll = new Collation($this->config, $this->logger, $this->connection, false); $coll->run(new ConsoleOutput($output)); |