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 getSource($name) |
||
42 | |||
43 | 4 | public function getSourceContext($name) |
|
49 | 1 | ||
50 | /** |
||
51 | 1 | * @inheritDoc |
|
52 | */ |
||
53 | public function getCacheKey($name) |
||
57 | 1 | ||
58 | /** |
||
59 | 1 | * @inheritDoc |
|
60 | */ |
||
61 | public function isFresh($name, $time) |
||
65 | 1 | ||
66 | /** |
||
67 | 1 | * @inheritDoc |
|
68 | 1 | */ |
|
69 | public function exists($name) |
||
77 | |||
78 | /** |
||
79 | * @param string $name |
||
80 | * |
||
81 | * @return string |
||
82 | 5 | * |
|
83 | * @throws LoaderException |
||
84 | 5 | * When $name is not found. |
|
85 | 1 | */ |
|
86 | private function template($name) |
||
99 | |||
100 | /** |
||
101 | 5 | * @param string $name |
|
102 | * |
||
103 | 5 | * @return string|null |
|
104 | */ |
||
105 | 5 | private function findTemplate($name) |
|
118 | |||
119 | /** |
||
120 | 5 | * @param string $name |
|
121 | * |
||
122 | 5 | * @return array |
|
123 | */ |
||
124 | 5 | private function possibleTemplateFiles($name) |
|
135 | |||
136 | /** |
||
137 | 5 | * @param string $name |
|
138 | * |
||
139 | 5 | * @return string |
|
140 | 5 | */ |
|
141 | private function normalizeName($name) |
||
148 | } |
||
149 |