Skip to content

Commit

Permalink
TASK: Improv error messages to be more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellienert committed Jun 18, 2018
1 parent aff2cf2 commit c8faa27
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Classes/Sitegeist/MagicWand/Command/CloneCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ public function remoteHostCommand(
$keepDb = false,
$remoteFlowCommand = null,
$sshOptions = ''
) {
)
{
// fallback
if ($remoteFlowCommand === null) {
$remoteFlowCommand = $this->flowCommand;
Expand Down Expand Up @@ -373,13 +374,13 @@ protected function checkConfiguration($remotePersistenceConfiguration)
$this->outputHeadLine('Check Configuration');
if ($remotePersistenceConfiguration['driver'] != 'pdo_mysql'
&& $this->databaseConfiguration['driver'] != 'pdo_mysql') {
$this->outputLine(' only mysql is supported');
$this->outputLine(sprintf('<error>Error:</error> Only mysql is supported. Remote: "%s" Local: "%s" configured.', $remotePersistenceConfiguration['driver'], $this->databaseConfiguration['driver']));
$this->quit(1);
}
if (in_array($remotePersistenceConfiguration['charset'], ['utf8','utf8mb4']) && in_array($this->databaseConfiguration['charset'], ['utf8','utf8mb4'])) {
// we accept utf8 and utf8mb4 beeing similar enough
if (in_array($remotePersistenceConfiguration['charset'], ['utf8', 'utf8mb4']) && in_array($this->databaseConfiguration['charset'], ['utf8', 'utf8mb4'])) {
// we accept utf8 and utf8mb4 being similar enough
} else if ($remotePersistenceConfiguration['charset'] != $this->databaseConfiguration['charset']) {
$this->outputLine(' the databases have to use the same charset');
$this->outputLine(sprintf('<error>Error:</error> The databases have to use the same charset. Remote: "%s", Local: "%s" configured.', $remotePersistenceConfiguration['charset'], $this->databaseConfiguration['charset']));
$this->quit(1);
}
$this->outputLine(' - Configuration seems ok ...');
Expand Down

0 comments on commit c8faa27

Please sign in to comment.