Mwalker has uploaded a new change for review.
https://gerrit.wikimedia.org/r/73527
Change subject: Make testing a little bit more friendly
......................................................................
Make testing a little bit more friendly
Don't always require an external DB. This is mostly for testing
purposes where we have to use the default DB and not an external
MySQL store.
Note that the patch files, whilst not SQLite safe, are not needed
because the ContributionTracking.sql file is up to date.
Change-Id: I0e583b33e3c9413cb04b95c4c238b3ddbd843764
---
M ContributionTracking.processor.php
1 file changed, 11 insertions(+), 4 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContributionTracking
refs/changes/27/73527/1
diff --git a/ContributionTracking.processor.php
b/ContributionTracking.processor.php
index cb072d2..80c120e 100644
--- a/ContributionTracking.processor.php
+++ b/ContributionTracking.processor.php
@@ -16,21 +16,28 @@
* ContributionTracking.php
* @global string $wgContributionTrackingDBpassword : Database password,
* defined in ContributionTracking.php
- * @staticvar DatabaseMysql $db
- * @return DatabaseMysql The established database connection
+ * @staticvar DatabaseBase $db
+ * @return DatabaseBase The established database connection
*/
static function contributionTrackingConnection() {
global $wgContributionTrackingDBserver,
$wgContributionTrackingDBname;
global $wgContributionTrackingDBuser,
$wgContributionTrackingDBpassword;
+ global $wgDBserver;
static $db;
if ( !$db ) {
- $db = new DatabaseMysql(
+ if ( $wgContributionTrackingDBserver === $wgDBserver ) {
+ $db = wfGetDB( DB_MASTER );
+ } else {
+ $db = new DatabaseMysql(
$wgContributionTrackingDBserver,
$wgContributionTrackingDBuser,
$wgContributionTrackingDBpassword,
- $wgContributionTrackingDBname );
+ $wgContributionTrackingDBname
+ );
+ }
+
$db->query( "SET names utf8" );
}
--
To view, visit https://gerrit.wikimedia.org/r/73527
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e583b33e3c9413cb04b95c4c238b3ddbd843764
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContributionTracking
Gerrit-Branch: master
Gerrit-Owner: Mwalker <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits