From fd042bfebd5b9f0181956d9e8f7d81c0364939a5 Mon Sep 17 00:00:00 2001 From: OverlordQ Date: Fri, 4 Dec 2009 23:11:28 +0000 Subject: [PATCH] Making the DBA handler configurable when using CACHE_DBA, still defaults to db3. Changed the constructor to only take one optional dir param, the only place it gets called is ObjectCache with no parameters. --- RELEASE-NOTES | 1 + includes/BagOStuff.php | 5 +++-- includes/DefaultSettings.php | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 075fa6805b..e050a63c70 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -99,6 +99,7 @@ Hopefully we will remove this configuration var soon) * $wgUseInstantCommons added for quick and easy enabling of Commons as a remote file repository * $wgWikiId added to override default output of wfWikiId() +* $wgDBAhandler added to choose a DBA handler when using CACHE_DBA === New features in 1.16 === diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index 2ec615369a..327bc5ad98 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -619,7 +619,8 @@ class XCacheBagOStuff extends BagOStuff { class DBABagOStuff extends BagOStuff { var $mHandler, $mFile, $mReader, $mWriter, $mDisabled; - public function __construct( $handler = 'db3', $dir = false ) { + public function __construct( $dir = false ) { + global $wgDBAhandler; if ( $dir === false ) { global $wgTmpDirectory; $dir = $wgTmpDirectory; @@ -627,7 +628,7 @@ class DBABagOStuff extends BagOStuff { $this->mFile = "$dir/mw-cache-" . wfWikiID(); $this->mFile .= '.db'; wfDebug( __CLASS__ . ": using cache file {$this->mFile}\n" ); - $this->mHandler = $handler; + $this->mHandler = $wgDBAhandler; } /** diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c1bb33aa87..c87bc5409e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -776,6 +776,8 @@ $wgParserCacheType = CACHE_ANYTHING; $wgParserCacheExpireTime = 86400; +$wgDBAhandler = 'db3'; + $wgSessionsInMemcached = false; /** This is used for setting php's session.save_handler. In practice, you will -- 2.20.1