summaryrefslogtreecommitdiff
path: root/includes/ExternalStoreDB.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
commitca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch)
treeec04cc15b867bc21eedca904cea9af0254531a11 /includes/ExternalStoreDB.php
parenta22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff)
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing
Diffstat (limited to 'includes/ExternalStoreDB.php')
-rw-r--r--includes/ExternalStoreDB.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/includes/ExternalStoreDB.php b/includes/ExternalStoreDB.php
index 877277a2..552c3109 100644
--- a/includes/ExternalStoreDB.php
+++ b/includes/ExternalStoreDB.php
@@ -18,7 +18,7 @@ class ExternalStoreDB {
*/
function &getLoadBalancer( $cluster ) {
$wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki'] : false;
-
+
return wfGetLBFactory()->getExternalLB( $cluster, $wiki );
}
@@ -29,8 +29,18 @@ class ExternalStoreDB {
* @return DatabaseBase object
*/
function &getSlave( $cluster ) {
+ global $wgDefaultExternalStore;
+
$wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki'] : false;
$lb =& $this->getLoadBalancer( $cluster );
+
+ if ( !in_array( "DB://" . $cluster, $wgDefaultExternalStore ) ) {
+ wfDebug( "read only external store" );
+ $lb->allowLagged(true);
+ } else {
+ wfDebug( "writable external store" );
+ }
+
return $lb->getConnection( DB_SLAVE, array(), $wiki );
}
@@ -139,8 +149,8 @@ class ExternalStoreDB {
function store( $cluster, $data ) {
$dbw = $this->getMaster( $cluster );
$id = $dbw->nextSequenceValue( 'blob_blob_id_seq' );
- $dbw->insert( $this->getTable( $dbw ),
- array( 'blob_id' => $id, 'blob_text' => $data ),
+ $dbw->insert( $this->getTable( $dbw ),
+ array( 'blob_id' => $id, 'blob_text' => $data ),
__METHOD__ );
$id = $dbw->insertId();
if ( !$id ) {