From 0f9580269969dacaa7f5e19b4549a23d55253fb7 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 16 Mar 2022 18:05:47 +0000 Subject: [PATCH] Fixed mis-automerge Signed-off-by: snipe --- app/Console/Commands/RestoreFromBackup.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/RestoreFromBackup.php b/app/Console/Commands/RestoreFromBackup.php index e780b35d6..fe778172c 100644 --- a/app/Console/Commands/RestoreFromBackup.php +++ b/app/Console/Commands/RestoreFromBackup.php @@ -246,18 +246,21 @@ class RestoreFromBackup extends Command return false; } $bytes_read = 0; + while (($buffer = fgets($sql_contents, self::$buffer_size)) !== false) { $bytes_read += strlen($buffer); // \Log::debug("Buffer is: '$buffer'"); $bytes_written = fwrite($pipes[0], $buffer); + if ($bytes_written === false) { $stdout = fgets($pipes[1]); $this->info($stdout); $stderr = fgets($pipes[2]); $this->info($stderr); - return false; + } } + if (!feof($sql_contents) || $bytes_read == 0) { return $this->error("Not at end of file for sql file, or zero bytes read. aborting!"); }