@@ -40,7 +40,7 @@ public function initialize()
4040 public function finalize ()
4141 {
4242 if ($ this ->used ) {
43- return ['Nette\Bridges\CacheLatte\CacheMacro::initRuntime($this, $this->global ); ' ];
43+ return ['Nette\Bridges\CacheLatte\CacheMacro::initRuntime($this); ' ];
4444 }
4545 }
4646
@@ -57,7 +57,7 @@ public function nodeOpened(Latte\MacroNode $node)
5757 $ this ->used = TRUE ;
5858 $ node ->isEmpty = FALSE ;
5959 $ node ->openingCode = Latte \PhpWriter::using ($ node )
60- ->write ('<?php if (Nette\Bridges\CacheLatte\CacheMacro::createCache($netteCacheStorage , %var, $this->global->caches , %node.array?)) { ?> ' ,
60+ ->write ('<?php if (Nette\Bridges\CacheLatte\CacheMacro::createCache($this->global->cacheStorage , %var, $this->global->cacheStack , %node.array?)) { ?> ' ,
6161 Nette \Utils \Random::generate ()
6262 );
6363 }
@@ -69,7 +69,7 @@ public function nodeOpened(Latte\MacroNode $node)
6969 */
7070 public function nodeClosed (Latte \MacroNode $ node )
7171 {
72- $ node ->closingCode = '<?php $_tmp = array_pop($this->global->caches ); if (!$_tmp instanceof stdClass) $_tmp->end(); } ?> ' ;
72+ $ node ->closingCode = '<?php $_tmp = array_pop($this->global->cacheStack ); if (!$_tmp instanceof stdClass) $_tmp->end(); } ?> ' ;
7373 }
7474
7575
@@ -79,12 +79,12 @@ public function nodeClosed(Latte\MacroNode $node)
7979 /**
8080 * @return void
8181 */
82- public static function initRuntime (Latte \Template $ template, $ global )
82+ public static function initRuntime (Latte \Template $ template )
8383 {
84- if (!empty ($ global ->caches )) {
84+ if (!empty ($ template -> global ->cacheStack )) {
8585 $ file = (new \ReflectionClass ($ template ))->getFileName ();
8686 if (@is_file ($ file )) { // @ - may trigger error
87- end ($ global ->caches )->dependencies [Cache::FILES ][] = $ file ;
87+ end ($ template -> global ->cacheStack )->dependencies [Cache::FILES ][] = $ file ;
8888 }
8989 }
9090 }
0 commit comments