* WikiText now permits the use of WAI-ARIA's role="presentation" inside of
html elements and tables. This allows presentational markup, especially
tables. To be marked up as such.
+* maintenance/sql.php learned the --cluster option. Let you run the script
+ on some external cluster instead of the primary cluster for a given wiki.
=== Bug fixes in 1.21 ===
* (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
public function __construct() {
parent::__construct();
$this->mDescription = "Send SQL queries to a MediaWiki database";
+ $this->addOption( 'cluster', 'Use an external cluster by name', false, true );
}
public function execute() {
- $dbw = wfGetDB( DB_MASTER );
- if ( $this->hasArg() ) {
- $fileName = $this->getArg();
- $file = fopen( $fileName, 'r' );
+ // Get a DB handle (with this wiki's DB select) from the appropriate load balancer
+ if ( $this->hasOption( 'cluster' ) ) {
+ $lb = wfGetLBFactory()->getExternalLB( $this->getOption( 'cluster' ) );
+ $dbw = $lb->getConnection( DB_MASTER ); // master for external LB
+ } else {
+ $dbw = wfGetDB( DB_MASTER ); // master for primary LB for this wiki
+ }
+ if ( $this->hasArg( 0 ) ) {
+ $file = fopen( $this->getArg( 0 ), 'r' );
if ( !$file ) {
$this->error( "Unable to open input file", true );
}