update twig to 2.9
This commit is contained in:
@@ -186,3 +186,30 @@ class Cache {
|
||||
}
|
||||
}
|
||||
|
||||
class Twig_Cache_TinyboardFilesystem extends Twig\Cache\FilesystemCache
|
||||
{
|
||||
private $directory;
|
||||
private $options;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct($directory, $options = 0)
|
||||
{
|
||||
parent::__construct($directory, $options);
|
||||
|
||||
$this->directory = $directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function was removed in Twig 2.x due to developer views on the Twig library. Who says we can't keep it for ourselves though?
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->directory), RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
|
||||
if ($file->isFile()) {
|
||||
@unlink($file->getPathname());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user