63 parent::__construct( $mainModule, $moduleName );
64 $this->specialPageFactory = $specialPageFactory;
65 $this->tempUserConfig = $tempUserConfig;
91 if ( !isset( $feedClasses[$this->params[
'feedformat']] ) ) {
95 $this->
getMain()->setCacheMode(
'public' );
98 $this->
getMain()->setCacheMaxAge( 15 );
101 $feedFormat = $this->params[
'feedformat'];
102 $specialPageName = $this->params[
'target'] !==
null
103 ?
'Recentchangeslinked'
106 $formatter = $this->getFeedObject( $feedFormat, $specialPageName );
117 $rc = $this->specialPageFactory->getPage( $specialPageName );
118 if ( $rc ===
null ) {
119 throw new RuntimeException( __METHOD__ .
' not able to instance special page ' . $specialPageName );
121 '@phan-var \MediaWiki\SpecialPage\ChangesListSpecialPage $rc';
122 $rc->setContext( $context );
123 $rows = $rc->getRows();
138 private function getFeedObject( $feedFormat, $specialPageName ) {
139 if ( $specialPageName ===
'Recentchangeslinked' ) {
140 $title = Title::newFromText( $this->params[
'target'] );
141 if ( !$title || $title->isExternal() ) {
146 $feedObj = $feed->getFeedObject(
147 $this->
msg(
'recentchangeslinked-title', $title->getPrefixedText() )
148 ->inContentLanguage()->text(),
149 $this->msg(
'recentchangeslinked-feed' )->inContentLanguage()->text(),
154 $feedObj = $feed->getFeedObject(
155 $this->
msg(
'recentchanges' )->inContentLanguage()->text(),
156 $this->
msg(
'recentchanges-feed-description' )->inContentLanguage()->text(),
170 ParamValidator::PARAM_DEFAULT =>
'rss',
171 ParamValidator::PARAM_TYPE => $feedFormatNames,
175 ParamValidator::PARAM_TYPE =>
'namespace',
179 'associated' =>
false,
182 ParamValidator::PARAM_DEFAULT => 7,
183 IntegerDef::PARAM_MIN => 1,
184 ParamValidator::PARAM_TYPE =>
'integer',
187 ParamValidator::PARAM_DEFAULT => 50,
188 IntegerDef::PARAM_MIN => 1,
190 ParamValidator::PARAM_TYPE =>
'integer',
193 ParamValidator::PARAM_TYPE =>
'timestamp',
196 'hideminor' =>
false,
199 ParamValidator::PARAM_DEFAULT =>
false,
201 'apihelp-feedrecentchanges-param-hideanons-temp' :
202 'apihelp-feedrecentchanges-param-hideanons',
205 'hidepatrolled' =>
false,
206 'hidemyself' =>
false,
207 'hidecategorization' =>
false,
210 ParamValidator::PARAM_TYPE =>
'string',
212 'inverttags' =>
false,
215 ParamValidator::PARAM_TYPE =>
'string',
217 'showlinkedto' =>
false,
223 'action=feedrecentchanges'
224 =>
'apihelp-feedrecentchanges-example-simple',
225 'action=feedrecentchanges&days=30'
226 =>
'apihelp-feedrecentchanges-example-30days',
231 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Feedrecentchanges';
236class_alias( ApiFeedRecentChanges::class,
'ApiFeedRecentChanges' );
wfEscapeWikiText( $input)
Escapes the given text so that it may be output using addWikiText() without any linking,...
array $params
The job parameters.
XML feed for Special:RecentChanges and Special:RecentChangesLinked.
static buildItems( $rows)
Generate the feed items given a row from the database.
This is the main API class, used for both external and internal processing.
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
An IContextSource implementation which will inherit context from another source but allow individual ...
A class containing constants representing the names of configuration variables.
const FeedClasses
Name constant for the FeedClasses setting, for use with Config::get()
const Feed
Name constant for the Feed setting, for use with Config::get()
const FeedLimit
Name constant for the FeedLimit setting, for use with Config::get()
Factory for handling the special page list and generating SpecialPage objects.
Parent class for all special pages.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...