aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/umpirsky/twig-gettext-extractor/Twig/Gettext/Loader/Filesystem.php
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>2013-08-04 17:50:34 +0200
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>2013-08-04 17:50:34 +0200
commit46b77928f746a4231d064774b5b67fd892c7ce86 (patch)
treee3ea690b3f0def1744ddae758923cf92171ef985 /vendor/umpirsky/twig-gettext-extractor/Twig/Gettext/Loader/Filesystem.php
parent68abd9c71b1d2f7bb2e9d21819584d1d15005b25 (diff)
downloadwallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.gz
wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.zst
wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.zip
rm vendor
Diffstat (limited to 'vendor/umpirsky/twig-gettext-extractor/Twig/Gettext/Loader/Filesystem.php')
-rw-r--r--vendor/umpirsky/twig-gettext-extractor/Twig/Gettext/Loader/Filesystem.php58
1 files changed, 0 insertions, 58 deletions
diff --git a/vendor/umpirsky/twig-gettext-extractor/Twig/Gettext/Loader/Filesystem.php b/vendor/umpirsky/twig-gettext-extractor/Twig/Gettext/Loader/Filesystem.php
deleted file mode 100644
index b011b032..00000000
--- a/vendor/umpirsky/twig-gettext-extractor/Twig/Gettext/Loader/Filesystem.php
+++ /dev/null
@@ -1,58 +0,0 @@
1<?php
2
3/**
4 * This file is part of the Twig Gettext utility.
5 *
6 * (c) Саша Стаменковић <umpirsky@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Twig\Gettext\Loader;
13
14/**
15 * Loads template from the filesystem.
16 *
17 * @author Саша Стаменковић <umpirsky@gmail.com>
18 */
19class Filesystem extends \Twig_Loader_Filesystem
20{
21 /**
22 * Hacked find template to allow loading templates by absolute path.
23 *
24 * @param string $name template name or absolute path
25 */
26 protected function findTemplate($name)
27 {
28 // normalize name
29 $name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/'));
30
31 if (isset($this->cache[$name])) {
32 return $this->cache[$name];
33 }
34
35 $this->validateName($name);
36
37 $namespace = '__main__';
38 if (isset($name[0]) && '@' == $name[0]) {
39 if (false === $pos = strpos($name, '/')) {
40 throw new \InvalidArgumentException(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name));
41 }
42
43 $namespace = substr($name, 1, $pos - 1);
44
45 $name = substr($name, $pos + 1);
46 }
47
48 if (!isset($this->paths[$namespace])) {
49 throw new \Twig_Error_Loader(sprintf('There are no registered paths for namespace "%s".', $namespace));
50 }
51
52 if (is_file($name)) {
53 return $this->cache[$name] = $name;
54 }
55
56 return __DIR__.'/../Test/Fixtures/twig/empty.twig';
57 }
58}