* 'id' -- HTML id attribute
* 'cssclass' -- CSS class
* 'csshelpclass' -- CSS class used to style help text
+ * 'dir' -- Direction of the element.
* 'options' -- associative array mapping labels to values.
* Some field types support multi-level arrays.
* 'options-messages' -- associative array mapping message keys to values.
protected $mValidationCallback;
protected $mFilterCallback;
protected $mName;
+ protected $mDir;
protected $mLabel; # String label. Set on construction
protected $mID;
protected $mClass = '';
$this->mName = $params['name'];
}
+ if ( isset( $params['dir'] ) ) {
+ $this->mDir = $params['dir'];
+ }
+
$validName = Sanitizer::escapeId( $this->mName );
$validName = str_replace( array( '.5B', '.5D' ), array( '[', ']' ), $validName );
if ( $this->mName != $validName && !isset( $params['nodata'] ) ) {
'name' => $this->mName,
'size' => $this->getSize(),
'value' => $value,
+ 'dir' => $this->mDir,
) + $this->getTooltipAndAccessKey();
if ( $this->mClass !== '' ) {
}
}
- /**
- * @return array
- */
- protected function doGetPeriodicTasks() {
- return array(); // managed in the runner loop
- }
-
/**
* @param IJobSpecification $job
* @return array
* @return string Text
*/
public function getIRCActionText() {
+ global $wgContLang;
+
$this->plaintext = true;
$this->irctext = true;
case 'block':
switch ( $entry->getSubtype() ) {
case 'block':
- global $wgContLang;
// Keep compatibility with extensions by checking for
// new key (5::duration/6::flags) or old key (0/optional 1)
if ( $entry->isLegacy() ) {
->rawParams( $target )->inContentLanguage()->escaped();
break;
case 'reblock':
- global $wgContLang;
$duration = $wgContLang->translateBlockExpiry( $parameters['5::duration'] );
$flags = BlockLogFormatter::formatBlockFlags( $parameters['6::flags'], $wgContLang );
$text = wfMessage( 'reblock-logentry' )
* @return void
*/
private function limitTitle( $page, $pattern ) {
- global $wgMiserMode;
+ global $wgMiserMode, $wgUserrightsInterwikiDelimiter;
if ( $page instanceof Title ) {
$title = $page;
$doUserRightsLogLike = false;
if ( $this->types == array( 'rights' ) ) {
- global $wgUserrightsInterwikiDelimiter;
$parts = explode( $wgUserrightsInterwikiDelimiter, $title->getDBKey() );
if ( count( $parts ) == 2 ) {
list( $name, $database ) = array_map( 'trim', $parts );
'<nowiki>' . $this->getLanguage()->commaList( $protocols_list ) . '</nowiki>',
count( $protocols_list )
);
- $s = Html::openElement(
- 'form',
- array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => wfScript() )
- ) . "\n" .
- Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) . "\n" .
- Html::openElement( 'fieldset' ) . "\n" .
- Html::element( 'legend', array(), $this->msg( 'linksearch' )->text() ) . "\n" .
- Xml::inputLabel(
- $this->msg( 'linksearch-pat' )->text(),
- 'target',
- 'target',
- 50,
- $target,
- array(
- // URLs are always ltr
- 'dir' => 'ltr',
- )
- ) . "\n";
-
+ $fields = array(
+ 'target' => array(
+ 'type' => 'text',
+ 'name' => 'target',
+ 'id' => 'target',
+ 'size' => 50,
+ 'label-message' => 'linksearch-pat',
+ 'default' => $target,
+ 'dir' => 'ltr',
+ )
+ );
if ( !$this->getConfig()->get( 'MiserMode' ) ) {
- $s .= Html::namespaceSelector(
- array(
- 'selected' => $namespace,
- 'all' => '',
- 'label' => $this->msg( 'linksearch-ns' )->text()
- ), array(
+ $fields += array(
+ 'namespace' => array(
+ 'class' => 'HTMLSelectNamespace',
'name' => 'namespace',
+ 'label-message' => 'linksearch-ns',
+ 'default' => $namespace,
'id' => 'namespace',
- 'class' => 'namespaceselector',
- )
+ 'cssclass' => 'namespaceselector',
+ ),
);
}
-
- $s .= Xml::submitButton( $this->msg( 'linksearch-ok' )->text() ) . "\n" .
- Html::closeElement( 'fieldset' ) . "\n" .
- Html::closeElement( 'form' ) . "\n";
- $out->addHTML( $s );
+ $hiddenFields = array(
+ 'title' => $this->getPageTitle()->getPrefixedDBkey(),
+ );
+ $htmlForm = HTMLForm::factory( 'inline', $fields, $this->getContext() );
+ $htmlForm->addHiddenFields( $hiddenFields );
+ $htmlForm->setSubmitTextMsg( 'linksearch-ok' );
+ $htmlForm->setWrapperLegendMsg( 'linksearch' );
+ $htmlForm->setAction( wfScript() );
+ $htmlForm->setMethod( 'get' );
+ $htmlForm->prepareForm()->displayForm( false );
if ( $target != '' ) {
$this->setParams( array(
parent::__construct();
$this->mDescription = 'Remove cache entries for removed ResourceLoader modules from the database';
$this->addOption( 'batchsize', 'Delete rows in batches of this size. Default: 500', false, true );
- $this->addOption(
- 'max-slave-lag',
- 'If the slave lag exceeds this many seconds, wait until it drops below this value. '
- . 'Default: 5',
- false,
- true
- );
}
public function execute() {
$moduleNames = $rl->getModuleNames();
$moduleList = implode( ', ', array_map( array( $dbw, 'addQuotes' ), $moduleNames ) );
$limit = max( 1, intval( $this->getOption( 'batchsize', 500 ) ) );
- $maxlag = intval( $this->getOption( 'max-slave-lag', 5 ) );
$this->output( "Cleaning up module_deps table...\n" );
$i = 1;
$numRows = $dbw->affectedRows();
$this->output( "Batch $i: $numRows rows\n" );
$i++;
- wfWaitForSlaves( $maxlag );
+ wfWaitForSlaves();
} while ( $numRows > 0 );
$this->output( "done\n" );
$numRows = $dbw->affectedRows();
$this->output( "Batch $i: $numRows rows\n" );
$i++;
- wfWaitForSlaves( $maxlag );
+ wfWaitForSlaves();
} while ( $numRows > 0 );
$this->output( "done\n" );
$numRows = $dbw->affectedRows();
$this->output( "Batch $i: $numRows rows\n" );
$i++;
- wfWaitForSlaves( $maxlag );
+ wfWaitForSlaves();
} while ( $numRows > 0 );
$this->output( "done\n" );
}
);
protected $dryrun = false;
- protected $maxLag = 10; # if slaves are lagged more than 10 secs, wait
public $batchSize = 100;
public $reportInterval = 100;
false,
true
);
- $this->addOption(
- 'max-slave-lag',
- 'If slave lag exceeds this many seconds, wait until it drops before continuing. Default: 10',
- false,
- true
- );
$this->addOption(
'throttle',
'Wait this many milliseconds after each category. Default: 0',
public function execute() {
$begin = $this->getOption( 'begin', '' );
- $maxSlaveLag = $this->getOption( 'max-slave-lag', 10 );
$throttle = $this->getOption( 'throttle', 0 );
$force = $this->getOption( 'force', false );
- $this->doPopulateCategory( $begin, $maxSlaveLag, $throttle, $force );
- }
- private function doPopulateCategory( $begin, $maxlag, $throttle, $force ) {
$dbw = wfGetDB( DB_MASTER );
if ( !$force ) {
public function execute() {
$this->dbw = wfGetDB( DB_MASTER );
- $this->maxLag = 10; # if slaves are lagged more than 10 secs, wait
$this->dryrun = $this->hasOption( 'dry-run' );
if ( $this->dryrun ) {
$GLOBALS['wgReadOnly'] = 'Dry run mode, image upgrades are suppressed';
$this->output( "MediaWiki {$wgVersion} Updater\n\n" );
- wfWaitForSlaves( 5 ); // let's not kill databases, shall we? ;) --tor
+ wfWaitForSlaves();
if ( !$this->hasOption( 'skip-compat-checks' ) ) {
$this->compatChecks();
* @author Aryeh Gregor (Simetrical)
*/
-#$optionsWithArgs = array( 'begin', 'max-slave-lag' );
-
require_once __DIR__ . '/Maintenance.php';
/**
<?php
/**
- * Wait until slave lag goes under a certain value.
+ * Wait for the slaves to catch up to the master position.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
require_once __DIR__ . '/Maintenance.php';
/**
- * Maintenance script to wait until slave lag goes under a certain value.
+ * Maintenance script to wait for the slaves to catch up to the master position.
*
* @ingroup Maintenance
*/
class WaitForSlave extends Maintenance {
- public function __construct() {
- parent::__construct();
- $this->addArg( 'maxlag', 'How long to wait for the slaves, default 10 seconds', false );
- }
-
public function execute() {
- wfWaitForSlaves( $this->getArg( 0, 10 ) );
+ wfWaitForSlaves();
}
}
ua.match( /Opera Mini/ ) ||
// Nokia's Ovi Browser
ua.match( /S40OviBrowser/ ) ||
+ // MeeGo's browser
+ ua.match( /MeeGo/ ) ||
// Google Glass browser groks JS but UI is too limited
( ua.match( /Glass/ ) && ua.match( /Android/ ) )
);
'Mozilla/5.0 (Series40; NokiaX3-02/05.60; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.2.0.0.6',
'Mozilla/5.0 (Series40; Nokia305/05.92; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.7.0.0.11',
// Google Glass
- 'Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Glass 1 Build/IMM76L; XE11) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30'
+ 'Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Glass 1 Build/IMM76L; XE11) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30',
+ // MeeGo
+ 'Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13'
],
// No explicit support for or against these browsers, they're given a shot at Grade A.
gradeX: [