50 lines
916 B
PHP
50 lines
916 B
PHP
<?php
|
|
|
|
namespace Shikiryu\WebGobbler;
|
|
|
|
abstract class Assembler
|
|
{
|
|
protected $files = [];
|
|
/**
|
|
* @var \Shikiryu\WebGobbler\Pool
|
|
*/
|
|
protected $pool;
|
|
|
|
/**
|
|
* @var \Shikiryu\WebGobbler\Config
|
|
*/
|
|
protected $config;
|
|
|
|
/**
|
|
* Assembler constructor.
|
|
*
|
|
* @param \Shikiryu\WebGobbler\Pool $pool
|
|
* @param \Shikiryu\WebGobbler\Config $config
|
|
*/
|
|
public function __construct(Pool $pool, Config $config)
|
|
{
|
|
$this->pool = $pool;
|
|
$this->config = $config;
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
* @link https://php.net/manual/en/language.oop5.decon.php
|
|
*/
|
|
public function __destruct()
|
|
{
|
|
foreach ($this->files as $file) {
|
|
unlink($file);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* @param string $file
|
|
*
|
|
* @return void
|
|
*/
|
|
abstract public function saveTo($file);
|
|
|
|
abstract public function display();
|
|
} |