-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Currently temporary files are deleted via the __destruct
method but this does not work when using PDFMerger through Laravel queues.
More info:
laravel/framework#18539
For this reason, it would be interesting to add a method that allows deleting temporary files manually for these use cases.
Something like this:
public function __destruct()
{
$this->cleanup();
}
public function cleanup()
{
$oFilesystem = $this->oFilesystem;
$this->tmpFiles->each(function ($filePath) use ($oFilesystem) {
$oFilesystem->delete($filePath);
});
}
$pdfMerger = PDFMerger::init();
$pdfMerger->addPDF($path1, 'all');
$pdfMerger->addPDF($path2, 'all');
$pdfMerger->merge();
$pdfMerger->save('merged_result.pdf');
$pdfMerger->cleanup()
What do you think about this?
rtaylor82, JanVormeister and davide-acanfora
Metadata
Metadata
Assignees
Labels
No labels