instead. The setTags() method was overriding the tags, addTags() doesn't
override, only adds new tags.
* Block::isValid is deprecated, since it is no longer needed in core.
+* Calling Maintenance::hasArg() as well as Maintenance::getArg() with no
+ parameter has been deprecated. Please pass the argument number 0.
=== Other changes in 1.33 ===
* (T201747) Html::openElement() warns if given an element name with a space
* @return bool
*/
protected function hasArg( $argId = 0 ) {
+ if ( func_num_args() === 0 ) {
+ wfDeprecated( __METHOD__ . ' without an $argId', '1.33' );
+ }
+
return isset( $this->mArgs[$argId] );
}
* @return mixed
*/
protected function getArg( $argId = 0, $default = null ) {
+ if ( func_num_args() === 0 ) {
+ wfDeprecated( __METHOD__ . ' without an $argId', '1.33' );
+ }
+
return $this->hasArg( $argId ) ? $this->mArgs[$argId] : $default;
}
// Set as a member variable to avoid function calls when we're timing the parse
$this->linkCache = MediaWikiServices::getInstance()->getLinkCache();
- $title = Title::newFromText( $this->getArg() );
+ $title = Title::newFromText( $this->getArg( 0 ) );
if ( !$title ) {
$this->error( "Invalid title" );
exit( 1 );
// Hack: Grant bot rights so we don't flood RecentChanges
$wgUser->addGroup( 'bot' );
- $spec = $this->getArg();
+ $spec = $this->getArg( 0 );
$protConds = [];
foreach ( [ 'http://', 'https://' ] as $prot ) {
}
$wgUser = $user;
- if ( $this->hasArg() ) {
- $file = fopen( $this->getArg(), 'r' );
+ if ( $this->hasArg( 0 ) ) {
+ $file = fopen( $this->getArg( 0 ), 'r' );
} else {
$file = $this->getStdin();
}
$wgUser->addToDatabase();
}
- $title = Title::newFromText( $this->getArg() );
+ $title = Title::newFromText( $this->getArg( 0 ) );
if ( !$title ) {
$this->fatalError( "Invalid title" );
}
$this->setNsfilter( explode( '|', $this->getOption( 'namespaces' ) ) );
}
- if ( $this->hasArg() ) {
- $this->importFromFile( $this->getArg() );
+ if ( $this->hasArg( 0 ) ) {
+ $this->importFromFile( $this->getArg( 0 ) );
} else {
$this->importFromStdin();
}
}
public function execute() {
- if ( $this->hasArg() ) {
+ if ( $this->hasArg( 0 ) ) {
$files = $this->mArgs;
} else {
$this->maybeHelp( true ); // @todo fixme this is a lame API :)
$this->fatalError( "MediaWiki isn't configured with a cache named '$cache'" );
}
$servers = $wgObjectCaches[$cache]['servers'];
- } elseif ( $this->hasArg() ) {
- $servers = [ $this->getArg() ];
+ } elseif ( $this->hasArg( 0 ) ) {
+ $servers = [ $this->getArg( 0 ) ];
} elseif ( $wgMainCacheType === CACHE_MEMCACHED ) {
global $wgMemCachedServers;
$servers = $wgMemCachedServers;
$reason = $this->getOption( 'r', '' );
$interval = $this->getOption( 'i', 0 );
$noredirects = $this->hasOption( 'noredirects' );
- if ( $this->hasArg() ) {
- $file = fopen( $this->getArg(), 'r' );
+ if ( $this->hasArg( 0 ) ) {
+ $file = fopen( $this->getArg( 0 ), 'r' );
} else {
$file = $this->getStdin();
}
}
public function execute() {
- $name = $this->getArg();
+ $name = $this->getArg( 0 );
$delete = $this->hasOption( 'delete' );
$dbw = $this->getDB( DB_MASTER );
}
public function execute() {
- $titleArg = $this->getArg();
+ $titleArg = $this->getArg( 0 );
$title = Title::newFromText( $titleArg );
$pageExists = $title && $title->exists();
$this->fatalError( "Invalid username" );
}
- $t = Title::newFromText( $this->getArg() );
+ $t = Title::newFromText( $this->getArg( 0 ) );
if ( !$t ) {
$this->fatalError( "Invalid title" );
}
}
public function execute() {
- $id = (int)$this->getArg();
+ $id = (int)$this->getArg( 0 );
$lookup = MediaWikiServices::getInstance()->getRevisionLookup();
$rev = $lookup->getRevisionById( $id );
$user = $this->getOption( 'user', false );
$reason = $this->getOption( 'reason', '' );
- $pageName = $this->getArg();
+ $pageName = $this->getArg( 0 );
$title = Title::newFromText( $pageName );
if ( !$title ) {
}
public function execute() {
- $title = Title::newFromText( $this->getArg() );
+ $title = Title::newFromText( $this->getArg( 0 ) );
if ( !$title ) {
$this->fatalError( "Invalid title" );
}