Skip to content

Commit

Permalink
Merge pull request #28 from mxgross/dev
Browse files Browse the repository at this point in the history
#22 Prevent warnings from being logged into the sql dump
  • Loading branch information
mxgross committed Nov 4, 2020
2 parents 9926d86 + 9a04a6f commit 0d6e91c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Controller/EasyBackupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,21 @@ private function backupDatabase(string $sqlDumpName)
$this->filesystem->touch($sqlDumpName);

foreach ($outputArr as $line) {
$this->filesystem->appendToFile($sqlDumpName, $line."\n");
if (!$this->startsWith('[Warning]', $line)) {
$this->filesystem->appendToFile($sqlDumpName, $line."\n");
}
}
}
}
}

private function startsWith($needle, $haystack)
{
$length = strlen($needle);

return substr($haystack, 0, $length) === $needle;
}

private function zipData($source, $destination)
{
if (extension_loaded('zip') === true) {
Expand Down

0 comments on commit 0d6e91c

Please sign in to comment.