Skip to content

Commit

Permalink
Merge pull request #22 from daniellienert/task/improve-error-messages
Browse files Browse the repository at this point in the history
TASK: Improve error messages to be more descriptive
  • Loading branch information
grebaldi authored Aug 27, 2018
2 parents 5c721b6 + c8faa27 commit b540cbe
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 b540cbe

Please sign in to comment.