From 2a3493e98afe8bb9519bb33a0190df32a76a9814 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Fri, 16 Nov 2018 17:39:07 +0100 Subject: [PATCH] BUGFIX: Support null as host-value --- Classes/Sitegeist/MagicWand/DBAL/SimpleDBAL.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Sitegeist/MagicWand/DBAL/SimpleDBAL.php b/Classes/Sitegeist/MagicWand/DBAL/SimpleDBAL.php index e48815e..b5c4b68 100644 --- a/Classes/Sitegeist/MagicWand/DBAL/SimpleDBAL.php +++ b/Classes/Sitegeist/MagicWand/DBAL/SimpleDBAL.php @@ -19,7 +19,7 @@ class SimpleDBAL { * @param string $database * @return string */ - public function buildCmd(string $driver, string $host, int $port, string $username, string $password, string $database): string + public function buildCmd(string $driver, ?string $host, int $port, string $username, string $password, string $database): string { if ($driver === 'pdo_mysql') { return sprintf('mysql --host=%s --port=%s --user=%s --password=%s %s', escapeshellarg($host), escapeshellarg($port), escapeshellarg($username), escapeshellarg($password), escapeshellarg($database)); @@ -37,7 +37,7 @@ public function buildCmd(string $driver, string $host, int $port, string $userna * @param string $database * @return string */ - public function buildDumpCmd(string $driver, string $host, int $port, string $username, string $password, string $database): string + public function buildDumpCmd(string $driver, ?string $host, int $port, string $username, string $password, string $database): string { if ($driver === 'pdo_mysql') { return sprintf('mysqldump --single-transaction --add-drop-table --host=%s --port=%d --user=%s --password=%s %s', escapeshellarg($host), escapeshellarg($port), escapeshellarg($username), escapeshellarg($password), escapeshellarg($database));