Skip to content
Snippets Groups Projects
Unverified Commit 8a4466f9 authored by Morris Jobke's avatar Morris Jobke
Browse files

Improve error message of charset convert script and behaviour


Signed-off-by: default avatarMorris Jobke <hey@morrisjobke.de>
parent f4ead7c7
No related branches found
No related tags found
No related merge requests found
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment