X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/d7967d5e4460e08b6b258307afbca0596b18a3dd..refs/tags/mediawiki-1.14.0:/includes/ExternalStoreDB.php diff --git a/includes/ExternalStoreDB.php b/includes/ExternalStoreDB.php index f9046f74..9fa7d1b1 100644 --- a/includes/ExternalStoreDB.php +++ b/includes/ExternalStoreDB.php @@ -1,12 +1,4 @@ allowLagged(true); - return $wgExternalLoadBalancers[$cluster]; + return wfGetLBFactory()->getExternalLB( $cluster ); } /** @todo Document.*/ @@ -65,7 +56,7 @@ class ExternalStoreDB { * Fetch data from given URL * @param string $url An url of the form DB://cluster/id or DB://cluster/id/itemid for concatened storage. */ - function fetchFromURL($url) { + function fetchFromURL( $url ) { $path = explode( '/', $url ); $cluster = $path[2]; $id = $path[3]; @@ -131,12 +122,11 @@ class ExternalStoreDB { * @return string URL */ function store( $cluster, $data ) { - $fname = 'ExternalStoreDB::store'; - - $dbw =& $this->getMaster( $cluster ); - + $dbw = $this->getMaster( $cluster ); $id = $dbw->nextSequenceValue( 'blob_blob_id_seq' ); - $dbw->insert( $this->getTable( $dbw ), array( 'blob_id' => $id, 'blob_text' => $data ), $fname ); + $dbw->insert( $this->getTable( $dbw ), + array( 'blob_id' => $id, 'blob_text' => $data ), + __METHOD__ ); $id = $dbw->insertId(); if ( $dbw->getFlag( DBO_TRX ) ) { $dbw->immediateCommit(); @@ -144,4 +134,3 @@ class ExternalStoreDB { return "DB://$cluster/$id"; } } -