From c8faa27ca0d9b19c1570927813acca0af3eba25e Mon Sep 17 00:00:00 2001 From: Daniel Lienert Date: Mon, 18 Jun 2018 21:54:23 +0200 Subject: [PATCH] TASK: Improv error messages to be more descriptive --- .../MagicWand/Command/CloneCommandController.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Classes/Sitegeist/MagicWand/Command/CloneCommandController.php b/Classes/Sitegeist/MagicWand/Command/CloneCommandController.php index aa0a78f..717f384 100644 --- a/Classes/Sitegeist/MagicWand/Command/CloneCommandController.php +++ b/Classes/Sitegeist/MagicWand/Command/CloneCommandController.php @@ -118,7 +118,8 @@ public function remoteHostCommand( $keepDb = false, $remoteFlowCommand = null, $sshOptions = '' - ) { + ) + { // fallback if ($remoteFlowCommand === null) { $remoteFlowCommand = $this->flowCommand; @@ -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: 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: 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 ...');