mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-11-28 00:20:00 +00:00
Drop backwards-compatibility; this is a tarball extension
Tarball extensions follow the branch versions development policy. Change-Id: I4ad623f61b4113ec76d2abf9e013de483e56170c
This commit is contained in:
parent
4ec204fc3f
commit
e41c493a68
|
@ -10,7 +10,7 @@
|
|||
"descriptionmsg": "replacetext-desc",
|
||||
"license-name": "GPL-2.0-or-later",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.35.0"
|
||||
"MediaWiki": ">= 1.40.0"
|
||||
},
|
||||
"type": "specialpage",
|
||||
"GroupPermissions": {
|
||||
|
|
20
src/Job.php
20
src/Job.php
|
@ -28,9 +28,7 @@ use RecentChange;
|
|||
use RequestContext;
|
||||
use TextContent;
|
||||
use Title;
|
||||
use WatchAction;
|
||||
use Wikimedia\ScopedCallback;
|
||||
use WikiPage;
|
||||
use WikitextContent;
|
||||
|
||||
/**
|
||||
|
@ -100,24 +98,10 @@ class Job extends JobParent {
|
|||
}
|
||||
|
||||
if ( $this->params['watch_page'] ) {
|
||||
if ( method_exists( \MediaWiki\Watchlist\WatchlistManager::class, 'addWatch' ) ) {
|
||||
// MW 1.37+
|
||||
$services->getWatchlistManager()->addWatch( $current_user, $new_title );
|
||||
} else {
|
||||
// Method was removed, but we only invoke it in versions its
|
||||
// still available, suppress phan error
|
||||
// @phan-suppress-next-line PhanUndeclaredStaticMethod
|
||||
WatchAction::doWatch( $new_title, $current_user );
|
||||
}
|
||||
|
||||
$services->getWatchlistManager()->addWatch( $current_user, $new_title );
|
||||
}
|
||||
} else {
|
||||
if ( method_exists( MediaWikiServices::class, 'getWikiPageFactory' ) ) {
|
||||
// MW 1.36+
|
||||
$wikiPage = MediaWikiServices::getInstance()->getWikiPageFactory()->newFromTitle( $this->title );
|
||||
} else {
|
||||
$wikiPage = new WikiPage( $this->title );
|
||||
}
|
||||
$wikiPage = MediaWikiServices::getInstance()->getWikiPageFactory()->newFromTitle( $this->title );
|
||||
$latestRevision = $wikiPage->getRevisionRecord();
|
||||
|
||||
if ( $latestRevision === null ) {
|
||||
|
|
|
@ -21,7 +21,6 @@ namespace MediaWiki\Extension\ReplaceText;
|
|||
|
||||
use ErrorPageError;
|
||||
use Html;
|
||||
use JobQueueGroup;
|
||||
use Language;
|
||||
use MediaWiki\Linker\LinkRenderer;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
|
@ -188,13 +187,7 @@ class SpecialReplaceText extends SpecialPage {
|
|||
|
||||
$jobs = $this->createJobsForTextReplacements();
|
||||
$services = MediaWikiServices::getInstance();
|
||||
if ( method_exists( $services, 'getJobQueueGroup' ) ) {
|
||||
// MW 1.37+
|
||||
$services->getJobQueueGroup()->push( $jobs );
|
||||
} else {
|
||||
// @phan-suppress-next-line PhanUndeclaredStaticMethod
|
||||
JobQueueGroup::singleton()->push( $jobs );
|
||||
}
|
||||
$services->getJobQueueGroup()->push( $jobs );
|
||||
|
||||
$count = $this->getLanguage()->formatNum( count( $jobs ) );
|
||||
$out->addWikiMsg(
|
||||
|
|
Loading…
Reference in a new issue