From 4c4fb5497874bb718ca036a8ef71dfa69831da6e Mon Sep 17 00:00:00 2001 From: Ashley Hindle Date: Sun, 20 Jan 2019 18:35:06 +0000 Subject: [PATCH] Fix connection error in private-dump --- private-dump | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/private-dump b/private-dump index e2ed60d..6d9e9a7 100755 --- a/private-dump +++ b/private-dump @@ -38,7 +38,7 @@ if (!$config->isValid()) { $databases = $config->get('databases'); foreach ($databases as $databaseName => $tables) { - $dumper = new \Ifsnop\Mysqldump\Mysqldump($config->getDSN($databaseName), $config->get('mysql.username'), $config->get('mysql.password'), $dumpSettings); + $dumper = new \Ifsnop\Mysqldump\Mysqldump($config->getDSN($databaseName), $config->get('connection.username'), $config->get('connection.password'), $dumpSettings); $tableLimits = $config->getTableLimits($databaseName); if (!empty($tableLimits)) { @@ -72,5 +72,9 @@ foreach ($databases as $databaseName => $tables) { return $transformer->transform($colValue, $columnReplacer); }); - $dumper->start('php://output'); + try { + $dumper->start('php://output'); + } catch (\Exception $e) { + $console->error("Failed to dump: {$e->getMessage()}", 3); + } }