<?php
...
abstract class AbstractGenerator implements GeneratorInterface, LoggerAwareInterface
{
use LoggerAwareTrait;
/**
* @var array
*/
public $temporaryFiles = [];
...
public function __destruct()
{
$this->removeTemporaryFiles();
}
...
/**
* Removes all temporary files.
*
* @return void
*/
public function removeTemporaryFiles()
{
foreach ($this->temporaryFiles as $file) {
$this->unlink($file);
}
}
...
protected function unlink($filename)
{
return $this->fileExists($filename) ? \unlink($filename) : false;
}
...
}
File: src/Knp/Snappy/Image.php
<?php
namespace Knp\Snappy;
/**
* Use this class to create a snapshot / thumbnail from a HTML page.
*
* @author Matthieu Bontemps <matthieu.bontemps@knplabs.com>
* @author Antoine Hérault <antoine.herault@knplabs.com>
*/
class Image extends AbstractGenerator
{
....
}
Hello,
I would like to add my Snappy gadget chain to PHPGGC.
Why?
Below is the responsible code.
File: src/Knp/Snappy/AbstractGenerator.php
File: src/Knp/Snappy/Image.php
How?
Proof Of Concept
Then we create the file test.php as follows.
File: test.php
Thank you