feat: reduce number of backups created when processing PDF files
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user