@@ 78-85 (lines=8) @@ | ||
75 | $generationTime = microtime(true) - $generationTimeMc; |
|
76 | $unprefixedKey = substr($key['key'], strlen($this->twigCachePrefix)); |
|
77 | ||
78 | if($this->cacheCollector instanceof CacheCollector){ |
|
79 | $this->cacheCollector->setTwigCacheBlock($unprefixedKey, [ |
|
80 | 'cacheHit' => $cacheData !== null, |
|
81 | 'cacheTtl' => $key['lifetime'], |
|
82 | 'cacheSize' => mb_strlen((string) $cacheData), |
|
83 | 'cacheGenTime' => $generationTime |
|
84 | ]); |
|
85 | } |
|
86 | ||
87 | if(!empty($cacheData) && $this->config['twig_block_debug']){ |
|
88 | return "<!-- BEGIN CACHE BLOCK OUTPUT '{$unprefixedKey}' -->\n{$cacheData}\n<!-- // END CACHE BLOCK OUTPUT '{$unprefixedKey}' -->"; |
|
@@ 116-123 (lines=8) @@ | ||
113 | { |
|
114 | $unprefixedKey = substr($key['key'], strlen($this->twigCachePrefix)); |
|
115 | ||
116 | if($this->cacheCollector instanceof CacheCollector){ |
|
117 | $this->cacheCollector->setTwigCacheBlock($unprefixedKey, [ |
|
118 | 'cacheHit' => false, |
|
119 | 'cacheTtl' => $key['lifetime'], |
|
120 | 'cacheSize' => mb_strlen((string) $block), |
|
121 | 'cacheGenTime' => $generationTime |
|
122 | ]); |
|
123 | } |
|
124 | ||
125 | return $this->cache->save($key['key'], $block, $key['lifetime']); |
|
126 | } |