From 7b6c185275437df2cf303884e6f2d3f6201fad0a Mon Sep 17 00:00:00 2001 From: rurban Date: Mon, 26 Apr 2004 12:15:01 +0000 Subject: [PATCH] check default config values git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@3369 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/IniConfig.php | 79 ++++++++++++++++++++++++++++++----------------- lib/config.php | 8 +++-- lib/main.php | 12 +++++-- 3 files changed, 64 insertions(+), 35 deletions(-) diff --git a/lib/IniConfig.php b/lib/IniConfig.php index e35672a5a..21d200414 100644 --- a/lib/IniConfig.php +++ b/lib/IniConfig.php @@ -1,5 +1,5 @@ $apkey) { - $val = @$rs[$rskey]; - if ($val) { - $DBAuthParams[$apkey] = $val; + if (isset($rs[$rskey])) { + $DBAuthParams[$apkey] = $rs[$rskey]; } } // Default Wiki pages global $GenericPages; + if (!isset($rs['DEFAULT_WIKI_PAGES'])) + $rs['DEFAULT_WIKI_PAGES'] = "ReleaseNotes:SteveWainstead:TestPage"; $GenericPages = preg_split('/\s*:\s*/', @$rs['DEFAULT_WIKI_PAGES']); // Wiki name regexp. Should be a define(), but too many places want @@ -223,7 +240,9 @@ function IniConfig($file) // Another "too-tricky" redefine global $KeywordLinkRegexp; - $keywords = preg_split('/\s*:\s*/', @$rs['KEYWORDS']); + if (!isset($rs['KEYWORDS'])) + $rs['KEYWORDS'] = "Category:Topic"; + $keywords = preg_split('/\s*:\s*/', $rs['KEYWORDS']); $KeywordLinkRegexp = '(?<=' . implode('|^', $keywords) . ')[[:upper:]].*$'; global $DisabledActions; @@ -462,8 +481,10 @@ function fix_configs() { } - // $Log: not supported by cvs2svn $ +// Revision 1.8 2004/04/23 16:55:59 zorloc +// If using Db auth and DBAUTH_AUTH_DSN is empty set DBAUTH_AUTH_DSN to $DBParams['dsn'] +// // Revision 1.7 2004/04/20 22:26:27 zorloc // Removed Pear_Config for parse_ini_file(). // diff --git a/lib/config.php b/lib/config.php index d90a3ea7a..401dc0a31 100644 --- a/lib/config.php +++ b/lib/config.php @@ -1,13 +1,11 @@ _dbsession = & new DB_Session($this->getDbh(), $prefix . $GLOBALS['DBParams']['db_session_table']); @@ -476,7 +476,6 @@ class WikiRequest extends Request { $this->_dbi->close(); unset($this->_dbi); - global $ErrorManager; $ErrorManager->flushPostponedErrors(); @@ -490,6 +489,10 @@ class WikiRequest extends Request { } Request::finish(); + if (!empty($this->_dbi)) + $this->_dbi->close(); + unset($this->_dbi); + exit; } @@ -882,6 +885,9 @@ main(); // $Log: not supported by cvs2svn $ +// Revision 1.134 2004/04/23 06:46:37 zorloc +// Leave DB connection open when USE_DB_SESSION is true so that session info can be written to the DB. +// // Revision 1.133 2004/04/20 18:10:31 rurban // config refactoring: // FileFinder is needed for WikiFarm scripts calling index.php -- 2.45.0