From 0701298fa19be2de601f3be61075a8ca954861dc Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 30 Jan 2025 14:59:02 +0000 Subject: [PATCH] Explicitly disable templating cache for tools/render-tpl. --- src/MisuzuContext.php | 4 ++-- tools/render-tpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MisuzuContext.php b/src/MisuzuContext.php index 0c531cea..89e31794 100644 --- a/src/MisuzuContext.php +++ b/src/MisuzuContext.php @@ -135,7 +135,7 @@ class MisuzuContext { return $this->chatUrl; } - public function startTemplating(): void { + public function startTemplating(bool $cache = true): void { $globals = $this->config->getValues([ ['eeprom.path:s', '', 'eeprom_path'], ['eeprom.app:s', '', 'eeprom_app'], @@ -150,7 +150,7 @@ class MisuzuContext { $this->templating = new TplEnvironment( MSZ_TEMPLATES, - cache: $isDebug ? null : ['Misuzu', GitInfo::hash(true)], + cache: $isDebug || !$cache ? null : ['Misuzu', GitInfo::hash(true)], debug: $isDebug ); $this->templating->addExtension(new TemplatingExtension($this)); diff --git a/tools/render-tpl b/tools/render-tpl index 4c5617ac..5b2f1bc3 100755 --- a/tools/render-tpl +++ b/tools/render-tpl @@ -80,7 +80,7 @@ $msz->createRouting(new HttpRequest('::1', true, 'XX', '1.1', 'GET', '/', [], [] new HttpHeader('Host', $hostName), ]), null)); -$msz->startTemplating(); +$msz->startTemplating(false); $ctx = $msz->templating->load(implode(' ', array_slice($argv, $pathIndex)));