verumconsilium / laravel-browsershot

Browsershot wrapper for Laravel 5
MIT License
110 stars 19 forks source link

add the possibility to set temp directory path #18

Closed okaufmann closed 4 years ago

okaufmann commented 4 years ago

When using laravel-browsershot, the temporary files won't be deleted. This because __sleep only gets called when the instance will be serialised (https://www.php.net/manual/en/language.oop5.magic.php#object.sleep).

I think its better to use __destruct to remove temp files.

I also find it useful to be able to set the temporary folder. So the created files can be cleaned up with a scheduled job.

For this I've added a new config variable.

Hope you like it 😄