1 | <?php |
||
9 | final class FilesystemLoader implements TwigLoader, TwigExistsLoader |
||
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 | /** |
||
39 | * @inheritDoc |
||
40 | */ |
||
41 | 4 | public function getSource($name) |
|
45 | |||
46 | /** |
||
47 | * @inheritDoc |
||
48 | */ |
||
49 | 1 | public function getCacheKey($name) |
|
53 | |||
54 | /** |
||
55 | * @inheritDoc |
||
56 | */ |
||
57 | 1 | public function isFresh($name, $time) |
|
61 | |||
62 | /** |
||
63 | * @inheritDoc |
||
64 | */ |
||
65 | 1 | public function exists($name) |
|
73 | |||
74 | /** |
||
75 | * @param string $name |
||
76 | * |
||
77 | * @return string |
||
78 | * |
||
79 | * @throws LoaderException |
||
80 | * When $name is not found. |
||
81 | */ |
||
82 | 5 | private function template($name) |
|
95 | |||
96 | /** |
||
97 | * @param string $name |
||
98 | * |
||
99 | * @return string|null |
||
100 | */ |
||
101 | 5 | private function findTemplate($name) |
|
114 | |||
115 | /** |
||
116 | * @param string $name |
||
117 | * |
||
118 | * @return array |
||
119 | */ |
||
120 | 5 | private function possibleTemplateFiles($name) |
|
131 | |||
132 | /** |
||
133 | * @param string $name |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | 5 | private function normalizeName($name) |
|
143 | } |
||
144 |