From 339e77330a7b0c3810b13c491c555a7c3a750ca7 Mon Sep 17 00:00:00 2001 From: rurban Date: Wed, 6 Apr 2005 06:19:30 +0000 Subject: [PATCH] Revert the previous wrong bugfix #1175761: USECACHE was mixed with WIKIDB_NOCACHE_MARKUP. Fix WIKIDB_NOCACHE_MARKUP in main (always set it) and clarify it in WikiDB git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@4658 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- config/config-default.ini | 3 ++- lib/WikiDB.php | 13 ++++++++----- lib/main.php | 13 ++++++++++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/config/config-default.ini b/config/config-default.ini index 297b218aa..8b58c7fb6 100644 --- a/config/config-default.ini +++ b/config/config-default.ini @@ -1,4 +1,4 @@ -; $Id: config-default.ini,v 1.29 2005-02-26 18:27:46 rurban Exp $ +; $Id: config-default.ini,v 1.30 2005-04-06 06:19:30 rurban Exp $ ; This is the default PhpWiki configuration for undefined config.ini entries. ; recent development and debugging features: @@ -10,6 +10,7 @@ JS_SEARCHREPLACE = true ENABLE_DOUBLECLICKEDIT = true ENABLE_XHTML_XML = false USECACHE = true +; calculated dynamically, but need a default WIKIDB_NOCACHE_MARKUP = false ENABLE_SPAMASSASSIN = false ENABLE_LIVESEARCH = false diff --git a/lib/WikiDB.php b/lib/WikiDB.php index dfe42e8cb..793312067 100644 --- a/lib/WikiDB.php +++ b/lib/WikiDB.php @@ -1,5 +1,5 @@ _wikidb->_backend; $newrevision = $this->createRevision($version, $wikitext, $meta, $links); - if ($newrevision and !WIKIDB_NOCACHE_MARKUP and USECACHE) + if ($newrevision and !WIKIDB_NOCACHE_MARKUP) $this->set('_cached_html', $formatted->pack()); // FIXME: probably should have some global state information @@ -1252,7 +1252,7 @@ class WikiDB_Page if (!$key || $key[0] == '%') return false; // several new SQL backends optimize this. - if (USECACHE + if (!WIKIDB_NOCACHE_MARKUP and $key == '_cached_html' and method_exists($backend, 'get_cached_html')) { @@ -1295,7 +1295,7 @@ class WikiDB_Page assert($key && $key[0] != '%'); // several new SQL backends optimize this. - if (USECACHE + if (!WIKIDB_NOCACHE_MARKUP and $key == '_cached_html' and method_exists($backend, 'set_cached_html')) { @@ -1571,7 +1571,7 @@ class WikiDB_PageRevision $this->getPackedContent(), $this->getMetaData()); - if (USECACHE and $possibly_cache_results) { + if ($possibly_cache_results and !WIKIDB_NOCACHE_MARKUP) { // If we're still the current version, cache the transfomed page. //$backend->lock(); if ($this->isCurrent()) { @@ -2135,6 +2135,9 @@ function _sql_debuglog_shutdown_function() { } // $Log: not supported by cvs2svn $ +// Revision 1.129 2005/04/06 05:50:29 rurban +// honor !USECACHE for _cached_html, fixes #1175761 +// // Revision 1.128 2005/04/01 16:11:42 rurban // just whitespace // diff --git a/lib/main.php b/lib/main.php index b282f9b4c..354619d89 100644 --- a/lib/main.php +++ b/lib/main.php @@ -1,5 +1,5 @@ */ - if (!defined('WIKIDB_NOCACHE_MARKUP') and $request->getArg('nocache')) - define('WIKIDB_NOCACHE_MARKUP', $request->getArg('nocache')); + if (!defined('WIKIDB_NOCACHE_MARKUP')) { + if ($request->getArg('nocache')) // 1 or purge + define('WIKIDB_NOCACHE_MARKUP', $request->getArg('nocache')); + else + define('WIKIDB_NOCACHE_MARKUP', false); + } // Initialize with system defaults in case user not logged in. // Should this go into constructor? @@ -1237,6 +1241,9 @@ if (!defined('PHPWIKI_NOMAIN') or !PHPWIKI_NOMAIN) // $Log: not supported by cvs2svn $ +// Revision 1.208 2005/02/28 21:24:32 rurban +// ignore forbidden ini_set warnings. Bug #1117254 by Xavier Roche +// // Revision 1.207 2005/02/10 19:03:37 rurban // try to avoid duoplicate lang/theme init // -- 2.45.0