1 | <?php |
||
14 | class PathStackResolver extends FileResolverAbstract |
||
15 | { |
||
16 | /** |
||
17 | * @var SplStack |
||
18 | */ |
||
19 | protected $paths; |
||
20 | |||
21 | /** |
||
22 | * Flag indicating whether or not LFI protection for rendering view scripts is enabled |
||
23 | * |
||
24 | * @var bool |
||
25 | */ |
||
26 | protected $lfiProtectionOn = true; |
||
27 | |||
28 | /** |
||
29 | * Constructor |
||
30 | */ |
||
31 | public function __construct() |
||
35 | |||
36 | /** |
||
37 | * Add many paths to the stack at once |
||
38 | * |
||
39 | * @param array|Traversable $paths |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | public function addPaths($paths) |
||
49 | |||
50 | /** |
||
51 | * Rest the path stack to the paths provided |
||
52 | * |
||
53 | * @param Traversable|array $paths |
||
54 | * |
||
55 | * @return void |
||
56 | * @throws Exception\InvalidArgumentException |
||
57 | */ |
||
58 | public function setPaths($paths) |
||
70 | |||
71 | /** |
||
72 | * Normalize a path for insertion in the stack |
||
73 | * |
||
74 | * @param string $path |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | protected function normalizePath($path) |
||
85 | |||
86 | /** |
||
87 | * Add a single path to the stack |
||
88 | * |
||
89 | * @param string $path |
||
90 | * |
||
91 | * @return void |
||
92 | * @throws Exception\InvalidArgumentException |
||
93 | */ |
||
94 | public function addPath($path) |
||
105 | |||
106 | /** |
||
107 | * Clear all paths |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | public function clearPaths() |
||
115 | |||
116 | /** |
||
117 | * Returns stack of paths |
||
118 | * |
||
119 | * @return SplStack |
||
120 | */ |
||
121 | public function getPaths() |
||
125 | |||
126 | /** |
||
127 | * Set LFI protection flag |
||
128 | * |
||
129 | * @param bool $flag |
||
130 | * @return void |
||
131 | */ |
||
132 | public function setLfiProtection($flag) |
||
136 | |||
137 | /** |
||
138 | * Return status of LFI protection flag |
||
139 | * |
||
140 | * @return bool |
||
141 | */ |
||
142 | public function isLfiProtectionOn() |
||
146 | |||
147 | /** |
||
148 | * {@inheritDoc} |
||
149 | */ |
||
150 | public function resolve($name) |
||
170 | |||
171 | /** |
||
172 | * {@inheritDoc} |
||
173 | */ |
||
174 | public function collect() |
||
202 | } |
||
203 |