psliwa / PHPPdf

Pdf and graphic files generator library written in php
http://ohey.pl
MIT License
339 stars 77 forks source link

Added a reset for the Engine's internal images array #80

Closed ramondelafuente closed 10 years ago

ramondelafuente commented 10 years ago

The engine currently keeps a hash of path => data presumably to allow optimizing for header/footer images on multilpe pages.

We are using the PHPdf library with the Symfony Bundle. We wrote a console command that runs forever, and generates single-page PDF's in a loop. Each page has a QR code, which get generated on disk in the same loop cycle.

With the current Engine, we have two options, both problematic:

This patch simply clears the internal Images array on reset().

verschoof commented 10 years ago

@psliwa can you consider this PR? :+1:

psliwa commented 10 years ago

Yes, of course. Thanks @ramondelafuente for PR. I've marged that PR manually, because I wanted to merge it also to 1.2.x branch: https://github.com/psliwa/PHPPdf/commit/b82a5d41df00061309cef481a366d59e5d5fb3d4

ramondelafuente commented 10 years ago

Nice! Thanks for the quick response.

ramondelafuente commented 10 years ago

Will you be making a new tag/release soon?

psliwa commented 10 years ago

Ok, I've created 1.2.5 tag with that fix.