| 1 | <?php |
||
| 12 | class SSViewerProxy extends SSViewer |
||
| 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 process($item, $arguments = null, $inheritedScope = null) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get the templates used in the current request and the number of times they were called |
||
| 41 | * |
||
| 42 | * @return array |
||
| 43 | */ |
||
| 44 | public static function getTemplatesUsed() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Remove the base path from a template file path and track its use |
||
| 51 | * |
||
| 52 | * @param string $templateName |
||
| 53 | */ |
||
| 54 | protected static function trackTemplateUsed($templateName) |
||
| 58 | } |
||
| 59 |