/**
* Compatibility functions
*
- * We support PHP 5.3.2 and up.
+ * We support PHP 5.3.3 and up.
* Re-implementations of newer functions or functions in non-standard
* PHP extensions may be included here.
*/
// Figure out which clusters need to be checked
$lbs = array();
if ( $cluster === '*' ) {
- wfGetLBFactory()->forEachLB( function( LoadBalancer $lb ) use ( &$lbs ) {
+ wfGetLBFactory()->forEachLB( function ( LoadBalancer $lb ) use ( &$lbs ) {
$lbs[] = $lb;
} );
} elseif ( $cluster !== false ) {
if ( $ifWritesSince && !$lb->hasMasterConnection() ) {
continue; // assume no writes done
}
- $dbw = $lb->getConnection( DB_MASTER, array(), $wiki );
+ // Use the empty string to not trigger selectDB() since the connection
+ // may have been to a server that does not have a DB for the current wiki.
+ $dbw = $lb->getConnection( DB_MASTER, array(), '' );
if ( $ifWritesSince && $dbw->lastDoneWrites() < $ifWritesSince ) {
continue; // no writes since the last wait
}