From aa3fab7d645750a51c98f9545b5228c8e724d02e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 7 Nov 2009 16:53:15 +0000 Subject: [PATCH] Flushing template cache is anoying while developing templates, now we can 'debug' the template cache --- inc/config-global.php | 3 +++ inc/config-local.php.dist | 3 +++ inc/filters.php | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/inc/config-global.php b/inc/config-global.php index 6b193f4b47..fe2f7c2090 100644 --- a/inc/config-global.php +++ b/inc/config-global.php @@ -95,6 +95,9 @@ setConfigEntry('CACHE_PATH', getConfig('PATH') . 'inc/cache/'); // CFG: STATS-ENABLED (temporary tables, if your database crashs all is gone) setConfigEntry('STATS_ENABLED', 'Y'); +// GLOBAL: DEBUG-TEMPLATE-CACHE +setConfigEntry('DEBUG_TEMPLATE_CACHE', 'N'); + // Connect to the MySQL database... loadIncludeOnce('inc/mysql-connect.php'); diff --git a/inc/config-local.php.dist b/inc/config-local.php.dist index f56fc506c9..19327b28c9 100644 --- a/inc/config-local.php.dist +++ b/inc/config-local.php.dist @@ -84,6 +84,9 @@ setConfigEntry('ENABLE_BACKLINK', 'Y'); // CFG: DEBUG-MODE (if enabled all mails will be *displayed* and *not* send!) setConfigEntry('DEBUG_MODE', 'Y'); +// CFG: DEBUG-TEMPLATE-CACHE +setConfigEntry('DEBUG_TEMPLATE_CACHE', 'N'); + // CFG: DEBUG-SQL (Logs all queries to inc/cache/mysql.log) //setConfigEntry('DEBUG_SQL', 'Y'); diff --git a/inc/filters.php b/inc/filters.php index 02e3efdfde..aeb90d9351 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -848,12 +848,15 @@ function FILTER_DISPLAY_PARSING_TIME () { // Filter for flushing template cache function FILTER_FLUSH_TEMPLATE_CACHE () { + // Do not flush when debugging the template cache + if (isDebuggingTemplateCache()) return; + // Do we have cached eval() data? if ((isset($GLOBALS['template_eval'])) && (count($GLOBALS['template_eval']) > 0)) { // Now flush all foreach ($GLOBALS['template_eval'] as $template=>$eval) { // Flush the cache (if not yet found) - //flushTemplateCache($template, $eval); + flushTemplateCache($template, $eval); } // END - if } // END - if } -- 2.39.5