1 | <?php |
||
12 | class TemplateParserProxy extends SSTemplateParser |
||
13 | { |
||
14 | /** |
||
15 | * Tracks all templates used in the current request |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected static $allTemplates = array(); |
||
20 | |||
21 | /** |
||
22 | * Whether the class has been used, meaning whether the page has been cached |
||
23 | * |
||
24 | * @var boolean |
||
25 | */ |
||
26 | protected static $cached = true; |
||
27 | |||
28 | /** |
||
29 | * Overloaded to track all templates used in the current request |
||
30 | * |
||
31 | * {@inheritDoc} |
||
32 | */ |
||
33 | public function compileString($string, $templateName = '', $includeDebuggingComments = false, $topTemplate = true) |
||
43 | |||
44 | /** |
||
45 | * Get the templates used in the current request and the number of times they were called |
||
46 | * |
||
47 | * @return array |
||
48 | */ |
||
49 | public static function getTemplatesUsed() |
||
53 | |||
54 | /** |
||
55 | * Determines whether the template rendering is cached or not based on whether the compileString method has been |
||
56 | * called at any point. |
||
57 | * |
||
58 | * @return bool |
||
59 | */ |
||
60 | public static function getCached() |
||
64 | |||
65 | /** |
||
66 | * Remove the base path from a template file path and track its use |
||
67 | * |
||
68 | * @param string $templateName |
||
69 | */ |
||
70 | protected static function trackTemplateUsed($templateName) |
||
74 | } |
||
75 |