From 4f5b44bd3bd490309eb2ba7b44df4769816ba729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 3 Aug 2013 19:26:54 +0200 Subject: twig implementation --- inc/3rdparty/Twig/Loader/Array.php | 98 -------------------------------------- 1 file changed, 98 deletions(-) delete mode 100644 inc/3rdparty/Twig/Loader/Array.php (limited to 'inc/3rdparty/Twig/Loader/Array.php') diff --git a/inc/3rdparty/Twig/Loader/Array.php b/inc/3rdparty/Twig/Loader/Array.php deleted file mode 100644 index 89087aea..00000000 --- a/inc/3rdparty/Twig/Loader/Array.php +++ /dev/null @@ -1,98 +0,0 @@ - - */ -class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterface -{ - protected $templates; - - /** - * Constructor. - * - * @param array $templates An array of templates (keys are the names, and values are the source code) - * - * @see Twig_Loader - */ - public function __construct(array $templates) - { - $this->templates = array(); - foreach ($templates as $name => $template) { - $this->templates[$name] = $template; - } - } - - /** - * Adds or overrides a template. - * - * @param string $name The template name - * @param string $template The template source - */ - public function setTemplate($name, $template) - { - $this->templates[(string) $name] = $template; - } - - /** - * {@inheritdoc} - */ - public function getSource($name) - { - $name = (string) $name; - if (!isset($this->templates[$name])) { - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); - } - - return $this->templates[$name]; - } - - /** - * {@inheritdoc} - */ - public function exists($name) - { - return isset($this->templates[(string) $name]); - } - - /** - * {@inheritdoc} - */ - public function getCacheKey($name) - { - $name = (string) $name; - if (!isset($this->templates[$name])) { - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); - } - - return $this->templates[$name]; - } - - /** - * {@inheritdoc} - */ - public function isFresh($name, $time) - { - $name = (string) $name; - if (!isset($this->templates[$name])) { - throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); - } - - return true; - } -} -- cgit v1.2.3