From 0a2a06fb8a9fc5081356e95e42e967870b671a3a Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 29 Sep 2023 11:15:40 +0200 Subject: [PATCH] Stream input of sql file when restoring backup. Makes everything better and faster --- src/Service/BackupService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Service/BackupService.php b/src/Service/BackupService.php index 3493259..57b8724 100644 --- a/src/Service/BackupService.php +++ b/src/Service/BackupService.php @@ -42,8 +42,10 @@ class BackupService $db, ]); + $stream = fopen($fileName, 'r'); + $process->setEnv(['MYSQL_PWD' => $this->credentials->getPassword()]); - $process->setInput(file_get_contents($fileName)); + $process->setInput($stream); $process->run(); } } \ No newline at end of file