From eeffaef7609999bc9f9e203f8d9ed2d0e1aa6db0 Mon Sep 17 00:00:00 2001 From: rurban Date: Sun, 19 Mar 2006 14:23:52 +0000 Subject: [PATCH] sf.net patch #1377011 by Matt Brown: add DATABASE_OPTIMISE_FREQUENCY git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@5031 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- config/config-dist.ini | 13 ++++++++++++- lib/IniConfig.php | 6 +++++- lib/WikiDB.php | 12 +++++++++--- lib/main.php | 9 +++++++-- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/config/config-dist.ini b/config/config-dist.ini index ee1b84cc5..ead8aeaec 100644 --- a/config/config-dist.ini +++ b/config/config-dist.ini @@ -13,7 +13,6 @@ ;========================================================================= ; Part Zero: Latest Development and Tricky Options ;========================================================================= - ; If PHP needs help in finding where you installed the rest of the PhpWiki ; code, you can set the include_path here. ; @@ -81,6 +80,7 @@ ; all external links to discourage spam. You might want to turn it off, ; if you want to improve pageranks on external links. ; TODO: Add ref=nofollow only for external links added by anonymous users. +; All internal action links do contain ref=nofollow ;GOOGLE_LINKS_NOFOLLOW = false ; LiveSearch enables immediate title search results via XMLHttpRequest. @@ -438,6 +438,17 @@ DATABASE_DBA_HANDLER = gdbm ; Specified in seconds. DATABASE_TIMEOUT = 5 +; How often to try and optimise the database. Specified in seconds. +; Set to 0 to disable optimisation completely. Default is 50 (seconds). +; +; This is a fairly crude way of doing things as it requires a page save +; to occur during the right minute for the optimisation to be triggered. +; +; With most modern databases (eg. Postgres) and distributions (eg. Debian) +; the system maintenance scripts take care of this nightly, so you will want +; to set this parameter to 0 (disabled). +;DATABASE_OPTIMISE_FREQUENCY = 50 + ; If action=upgrade detects mysql problems, but has no ALTER permissions, ; give here a database username which has the necessary ALTER or CREATE permissions. ; Of course you can fix your database manually. See lib/upgrade.php for known issues. diff --git a/lib/IniConfig.php b/lib/IniConfig.php index 8cb7957a7..94f49458a 100644 --- a/lib/IniConfig.php +++ b/lib/IniConfig.php @@ -1,5 +1,5 @@ 0 and + (time() % DATABASE_OPTIMISE_FREQUENCY == 0))) { if ($backend->optimize()) trigger_error(_("Optimizing database"), E_USER_NOTICE); } @@ -2254,6 +2256,10 @@ function _sql_debuglog_shutdown_function() { } // $Log: not supported by cvs2svn $ +// Revision 1.139 2006/01/12 16:38:07 rurban +// add page method listRelations() +// fix bug #1327912 numeric pagenames can break plugins (Joachim Lous) +// // Revision 1.138 2005/11/14 22:27:07 rurban // add linkrelation support // getPageLinks returns now an array of hashes diff --git a/lib/main.php b/lib/main.php index 7254f75b0..49880f733 100644 --- a/lib/main.php +++ b/lib/main.php @@ -1,5 +1,5 @@ setArg('pagename', $this->_deducePagename()); $this->setArg('action', $this->_deduceAction()); - if ((DEBUG & _DEBUG_SQL) or (time() % 50 == 0)) { + if ((DEBUG & _DEBUG_SQL) + or (DATABASE_OPTIMISE_FREQUENCY > 0 and + (time() % DATABASE_OPTIMISE_FREQUENCY == 0))) { if ($this->_dbi->_backend->optimize()) trigger_error(_("Optimizing database"), E_USER_NOTICE); } @@ -1273,6 +1275,9 @@ if (!defined('PHPWIKI_NOMAIN') or !PHPWIKI_NOMAIN) // $Log: not supported by cvs2svn $ +// Revision 1.220 2006/03/07 21:04:15 rurban +// wikihash for php-5.1 +// // Revision 1.219 2005/10/30 14:20:42 rurban // move Captcha specific vars and methods into a Captcha object // randomize Captcha chars positions and angles (smoothly) -- 2.45.0