1 | <?php |
||
25 | class CFSTemplateManager implements TemplateManager |
||
26 | { |
||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $cache_dir; |
||
31 | |||
32 | /** |
||
33 | * @var CFSWrapper |
||
34 | */ |
||
35 | protected $cascading_files; |
||
36 | |||
37 | /** |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $compiled_paths = []; |
||
41 | |||
42 | /** |
||
43 | * @var TemplateCompiler |
||
44 | */ |
||
45 | protected $compiler; |
||
46 | |||
47 | /** |
||
48 | * @var boolean |
||
49 | */ |
||
50 | protected $recompile_always; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $template_dir; |
||
56 | |||
57 | /** |
||
58 | * Valid options: |
||
59 | * * cache_dir => the path where compiled templates will be cached |
||
60 | * * recompile_always => whether to recompile each template on every execution, |
||
61 | * * template_dir => directory (in the cascading filesystem) to search for templates |
||
62 | * |
||
63 | * @param TemplateCompiler $compiler |
||
64 | * @param array $options |
||
65 | * @param null|CFSWrapper $cascading_files |
||
66 | */ |
||
67 | public function __construct(TemplateCompiler $compiler, array $options, CFSWrapper $cascading_files = NULL) |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function getPath($template_name) |
||
92 | |||
93 | /** |
||
94 | * @param string $compiled_path |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | protected function isCompileRequired($compiled_path) |
||
106 | |||
107 | /** |
||
108 | * @param string $template_name |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | protected function requireSourceFileContent($template_name) |
||
120 | |||
121 | /** |
||
122 | * @param string $compiled_path |
||
123 | * @param string $compiled |
||
124 | */ |
||
125 | protected function writeFile($compiled_path, $compiled) |
||
130 | |||
131 | /** |
||
132 | * @param string $path |
||
133 | */ |
||
134 | protected function ensureWriteableDirectory($path) |
||
146 | |||
147 | } |
||
148 |