feat: reduce number of backups created when processing PDF files

This commit is contained in:
Björn Fromme
2026-03-15 12:42:28 +01:00
parent 65187657f9
commit 0652ca9f8b
2 changed files with 141 additions and 2 deletions
+6 -2
View File
@@ -64,7 +64,7 @@ class InvoiceApprover extends AbstractPdfRenderer
{
$filesystem = new Filesystem();
if (!$filesystem->exists($source)) {
if (false === $filesystem->exists($source)) {
return;
}
@@ -72,7 +72,11 @@ class InvoiceApprover extends AbstractPdfRenderer
$filename = pathinfo($source, PATHINFO_FILENAME);
$extension = pathinfo($source, PATHINFO_EXTENSION);
$target = sprintf('%s/%s.bak.%s', $path, $filename, $extension);
$target = sprintf('%s/%s.orig.%s', $path, $filename, $extension);
if (true === $filesystem->exists($target)) {
return;
}
$filesystem->copy($source, $target);
}