1 | <?php |
||
9 | final class FilesystemLoader implements Twig_LoaderInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $path; |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | private $fileExtensions = []; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $cache = []; |
||
25 | |||
26 | /** |
||
27 | * @param string $path The template directory path |
||
28 | * @param array $fileExtensions The template file extensions |
||
29 | */ |
||
30 | 6 | public function __construct( |
|
37 | |||
38 | public function getSourceContext($name) |
||
46 | |||
47 | /** |
||
48 | * @inheritDoc |
||
49 | 1 | */ |
|
50 | public function getCacheKey($name) |
||
54 | |||
55 | /** |
||
56 | * @inheritDoc |
||
57 | 1 | */ |
|
58 | public function isFresh($name, $time) |
||
62 | |||
63 | /** |
||
64 | * @inheritDoc |
||
65 | 1 | */ |
|
66 | public function exists($name) |
||
74 | |||
75 | /** |
||
76 | * @param string $name |
||
77 | * |
||
78 | * @return string |
||
79 | * |
||
80 | * @throws LoaderException |
||
81 | * When $name is not found. |
||
82 | 5 | */ |
|
83 | private function template($name) |
||
96 | |||
97 | /** |
||
98 | * @param string $name |
||
99 | * |
||
100 | * @return string|null |
||
101 | 5 | */ |
|
102 | private function findTemplate($name) |
||
115 | |||
116 | /** |
||
117 | * @param string $name |
||
118 | * |
||
119 | * @return array |
||
120 | 5 | */ |
|
121 | private function possibleTemplateFiles($name) |
||
132 | |||
133 | /** |
||
134 | * @param string $name |
||
135 | * |
||
136 | * @return string |
||
137 | 5 | */ |
|
138 | private function normalizeName($name) |
||
145 | } |
||
146 |