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 --- .../Twig/Extensions/Gettext/Loader/Filesystem.php | 58 ---------------------- 1 file changed, 58 deletions(-) delete mode 100644 inc/3rdparty/Twig/Extensions/Gettext/Loader/Filesystem.php (limited to 'inc/3rdparty/Twig/Extensions/Gettext/Loader') diff --git a/inc/3rdparty/Twig/Extensions/Gettext/Loader/Filesystem.php b/inc/3rdparty/Twig/Extensions/Gettext/Loader/Filesystem.php deleted file mode 100644 index b011b032..00000000 --- a/inc/3rdparty/Twig/Extensions/Gettext/Loader/Filesystem.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Twig\Gettext\Loader; - -/** - * Loads template from the filesystem. - * - * @author Саша Стаменковић - */ -class Filesystem extends \Twig_Loader_Filesystem -{ - /** - * Hacked find template to allow loading templates by absolute path. - * - * @param string $name template name or absolute path - */ - protected function findTemplate($name) - { - // normalize name - $name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/')); - - if (isset($this->cache[$name])) { - return $this->cache[$name]; - } - - $this->validateName($name); - - $namespace = '__main__'; - if (isset($name[0]) && '@' == $name[0]) { - if (false === $pos = strpos($name, '/')) { - throw new \InvalidArgumentException(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name)); - } - - $namespace = substr($name, 1, $pos - 1); - - $name = substr($name, $pos + 1); - } - - if (!isset($this->paths[$namespace])) { - throw new \Twig_Error_Loader(sprintf('There are no registered paths for namespace "%s".', $namespace)); - } - - if (is_file($name)) { - return $this->cache[$name] = $name; - } - - return __DIR__.'/../Test/Fixtures/twig/empty.twig'; - } -} -- cgit v1.2.3