Commit 73a0c0d9 authored by drumm's avatar drumm Committed by Neil Drumm

Show output on error for debugging.

parent 1a650d01
...@@ -101,7 +101,7 @@ class provisionService_db_mysql extends provisionService_db_pdo { ...@@ -101,7 +101,7 @@ class provisionService_db_mysql extends provisionService_db_pdo {
$success = $this->safe_shell_exec($cmd, drush_get_option('db_host'), urldecode(drush_get_option('db_user')), urldecode(drush_get_option('db_passwd'))); $success = $this->safe_shell_exec($cmd, drush_get_option('db_host'), urldecode(drush_get_option('db_user')), urldecode(drush_get_option('db_passwd')));
if (!$success && !drush_get_option('force', false)) { if (!$success && !drush_get_option('force', false)) {
drush_set_error('PROVISION_BACKUP_FAILED', dt("Could not generate database backup from mysqldump")); drush_set_error('PROVISION_BACKUP_FAILED', dt('Could not generate database backup from mysqldump. (error: %msg)', array('%msg' => $this->safe_shell_exec_output)));
} }
// Reset the umask to normal permissions. // Reset the umask to normal permissions.
umask(0022); umask(0022);
...@@ -128,12 +128,12 @@ password=%s ...@@ -128,12 +128,12 @@ password=%s
3 => array("pipe", "r"), // fd3 is our special file descriptor where we pass credentials 3 => array("pipe", "r"), // fd3 is our special file descriptor where we pass credentials
); );
$process = proc_open($cmd, $descriptorspec, $pipes); $process = proc_open($cmd, $descriptorspec, $pipes);
$output = ""; $this->safe_shell_exec_output = '';
if (is_resource($process)) { if (is_resource($process)) {
fwrite($pipes[3], $mycnf); fwrite($pipes[3], $mycnf);
fclose($pipes[3]); fclose($pipes[3]);
$output = stream_get_contents($pipes[1]) . stream_get_contents($pipes[2]); $this->safe_shell_exec_output = stream_get_contents($pipes[1]) . stream_get_contents($pipes[2]);
// "It is important that you close any pipes before calling // "It is important that you close any pipes before calling
// proc_close in order to avoid a deadlock" // proc_close in order to avoid a deadlock"
fclose($pipes[1]); fclose($pipes[1]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment