move a title to an interwiki target
* (bug 16638) 8-bit URL fallback encoding now set on additional languages using
Arabic script (Persian, Urdu, Sindhi, Punjabi)
+* (bug 16656) cleanupTitles and friends should now work in load-balanced
+ DB environments when $wgDBserver isn't set.
=== API changes in 1.14 ===
function FiveUpgrade() {
$this->conversionTables = $this->prepareWindows1252();
- $this->dbw =& $this->newConnection();
- $this->dbr =& $this->streamConnection();
+ $this->loadBalancers = array();
+ $this->dbw = wfGetDB( DB_MASTER );
+ $this->dbr = $this->streamConnection();
$this->cleanupSwaps = array();
$this->emailAuth = false; # don't preauthenticate emails
* @return Database
* @access private
*/
- function &newConnection() {
- global $wgDBadminuser, $wgDBadminpassword, $wgDBtype;
- global $wgDBserver, $wgDBname;
- $dbclass = 'Database' . ucfirst( $wgDBtype ) ;
- $db = new $dbclass( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
+ function newConnection() {
+ $lb = wfGetLBFactory()->newMainLB();
+ $db = $lb->getConnection( DB_MASTER );
+
+ $this->loadBalancers[] = $lb;
return $db;
}
+
+ /**
+ * Close out the connections when we're done...
+ * Is this needed?
+ */
+ function close() {
+ foreach( $this->loadBalancers as $lb ) {
+ $lb->commitMasterChanges();
+ $lb->closeAll();
+ }
+ }
/**
* Open a second connection to the master server, with buffering off.
* @return Database
* @access private
*/
- function &streamConnection() {
+ function streamConnection() {
global $wgDBtype;
$timeout = 3600 * 24;