diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-23 15:36:22 -0600 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-23 15:36:22 -0600 |
commit | 8a4466f9ae916b59a13c93ccabd2d01742e9597f (patch) | |
tree | 863f98bfe7197e8d087311bd0e51220e1a830a3a /core/Command | |
parent | f4ead7c7d3617d8402e8a81d056e2e22f6cc341c (diff) | |
download | nextcloud-server-8a4466f9ae916b59a13c93ccabd2d01742e9597f.tar.gz nextcloud-server-8a4466f9ae916b59a13c93ccabd2d01742e9597f.zip |
Improve error message of charset convert script and behaviour
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Db/ConvertMysqlToMB4.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/Command/Db/ConvertMysqlToMB4.php b/core/Command/Db/ConvertMysqlToMB4.php index 5302b3cf5fb..286274753ee 100644 --- a/core/Command/Db/ConvertMysqlToMB4.php +++ b/core/Command/Db/ConvertMysqlToMB4.php @@ -71,17 +71,18 @@ 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()) { $url = $this->urlGenerator->linkToDocs('admin-mysql-utf8mb4'); $output->writeln("The database is not properly setup to use the charset utf8mb4."); - $output->writeln("Also check that the setting 'mysql.utf8mb4' is set to true in the config.php."); $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)); |