We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1128ab4 commit a0c400eCopy full SHA for a0c400e
src/Bridges/CacheLatte/CacheMacro.php
@@ -81,10 +81,13 @@ public function nodeClosed(Latte\MacroNode $node)
81
*/
82
public static function initRuntime(Latte\Template $template, $global)
83
{
84
- if (!empty($global->caches) && $template->getEngine()->getLoader() instanceof Latte\Loaders\FileLoader) {
85
- end($global->caches)->dependencies[Nette\Caching\Cache::FILES][] = $template->getName();
+ if (!empty($global->caches)) {
+ $file = (new \ReflectionClass($template))->getFileName();
86
+ if (@is_file($file)) { // @ - may trigger error
87
+ end($global->caches)->dependencies[Cache::FILES][] = $file;
88
}
89
90
+ }
91
92
93
/**
0 commit comments