From 7efb99d67e31a54634b9668aa641e73e443a6ddc Mon Sep 17 00:00:00 2001 From: rurban Date: Thu, 9 Dec 2004 22:24:44 +0000 Subject: [PATCH] optimize on _DEBUG_SQL only. but now again on every 50th request, not just save. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@4254 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/WikiDB.php | 17 ++++++++++++++--- lib/main.php | 12 +++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/lib/WikiDB.php b/lib/WikiDB.php index 9efc4bf10..92022ccb4 100644 --- a/lib/WikiDB.php +++ b/lib/WikiDB.php @@ -1,5 +1,5 @@ optimize()) trigger_error(_("Optimizing database"), E_USER_NOTICE); } @@ -1983,7 +1983,10 @@ class WikiDB_cache $this->_backend->update_pagedata($pagename, $newdata); - if (USECACHE and !empty($this->_pagedata_cache[$pagename]) and is_array($this->_pagedata_cache[$pagename])) { + if (USECACHE + and !empty($this->_pagedata_cache[$pagename]) + and is_array($this->_pagedata_cache[$pagename])) + { $cachedata = &$this->_pagedata_cache[$pagename]; foreach($newdata as $key => $val) $cachedata[$key] = $val; @@ -2125,6 +2128,14 @@ function _sql_debuglog_shutdown_function() { } // $Log: not supported by cvs2svn $ +// Revision 1.113 2004/12/06 19:49:55 rurban +// enable action=remove which is undoable and seeable in RecentChanges: ADODB ony for now. +// renamed delete_page to purge_page. +// enable action=edit&version=-1 to force creation of a new version. +// added BABYCART_PATH config +// fixed magiqc in adodb.inc.php +// and some more docs +// // Revision 1.112 2004/11/30 17:45:53 rurban // exists_links backend implementation // diff --git a/lib/main.php b/lib/main.php index 36731212a..15bd64b05 100644 --- a/lib/main.php +++ b/lib/main.php @@ -1,5 +1,5 @@ _dbi = WikiDB::open($GLOBALS['DBParams']); // first mysql request costs [958ms]! [670ms] is mysql_connect() - //if ((DEBUG & _DEBUG_TRACE) or (time() % 50 == 0)) - // $this->_dbi->_backend->optimize(); if (in_array('File', $this->_dbi->getAuthParam('USER_AUTH_ORDER'))) { // force our local copy, until the pear version is fixed. include_once(dirname(__FILE__)."/pear/File_Passwd.php"); @@ -64,6 +62,11 @@ $this->version = phpwiki_version(); // Normalize args... $this->setArg('pagename', $this->_deducePagename()); $this->setArg('action', $this->_deduceAction()); + + if ((DEBUG & _DEBUG_SQL) or (time() % 50 == 0)) { + if ($this->_dbi->_backend->optimize()) + trigger_error(_("Optimizing database"), E_USER_NOTICE); + } // Restore auth state. This doesn't check for proper authorization! if (ENABLE_USER_NEW) { @@ -1177,6 +1180,9 @@ if (!defined('PHPWIKI_NOMAIN') or !PHPWIKI_NOMAIN) // $Log: not supported by cvs2svn $ +// Revision 1.194 2004/11/30 17:46:49 rurban +// added ModeratedPage POST action hook (part 2/3) +// // Revision 1.193 2004/11/30 07:51:08 rurban // fixed SESSION_SAVE_PATH warning msg // -- 2.45.0