40 parent::__construct( $mainModule, $moduleName );
66 '@phan-var array<string,class-string<ChannelFeed>> $feedClasses';
67 if ( !isset( $feedClasses[$this->params[
'feedformat']] ) ) {
71 $this->
getMain()->setCacheMode(
'public' );
74 $this->
getMain()->setCacheMaxAge( 15 );
77 $feedFormat = $this->params[
'feedformat'];
78 $specialPageName = $this->params[
'target'] !==
null
79 ?
'Recentchangeslinked'
82 $formatter = $this->getFeedObject( $feedFormat, $specialPageName );
93 $rc = $this->specialPageFactory->getPage( $specialPageName );
95 throw new RuntimeException( __METHOD__ .
' not able to instance special page ' . $specialPageName );
97 '@phan-var \MediaWiki\SpecialPage\ChangesListSpecialPage $rc';
98 $rc->setContext( $context );
99 $rows = $rc->getRows();
114 private function getFeedObject( $feedFormat, $specialPageName ) {
115 if ( $specialPageName ===
'Recentchangeslinked' ) {
116 $title = Title::newFromText( $this->params[
'target'] );
117 if ( !$title || $title->isExternal() ) {
121 $feed =
new ChangesFeed( $feedFormat );
122 $feedObj = $feed->getFeedObject(
123 $this->
msg(
'recentchangeslinked-title', $title->getPrefixedText() )
124 ->inContentLanguage()->text(),
125 $this->msg(
'recentchangeslinked-feed' )->inContentLanguage()->text(),
129 $feed =
new ChangesFeed( $feedFormat );
130 $feedObj = $feed->getFeedObject(
131 $this->
msg(
'recentchanges' )->inContentLanguage()->text(),
132 $this->
msg(
'recentchanges-feed-description' )->inContentLanguage()->text(),
147 ParamValidator::PARAM_DEFAULT =>
'rss',
148 ParamValidator::PARAM_TYPE => $feedFormatNames,
152 ParamValidator::PARAM_TYPE =>
'namespace',
156 'associated' =>
false,
159 ParamValidator::PARAM_DEFAULT => 7,
160 IntegerDef::PARAM_MIN => 1,
161 ParamValidator::PARAM_TYPE =>
'integer',
164 ParamValidator::PARAM_DEFAULT => 50,
165 IntegerDef::PARAM_MIN => 1,
167 ParamValidator::PARAM_TYPE =>
'integer',
170 ParamValidator::PARAM_TYPE =>
'timestamp',
173 'hideminor' =>
false,
176 ParamValidator::PARAM_DEFAULT =>
false,
178 'apihelp-feedrecentchanges-param-hideanons-temp' :
179 'apihelp-feedrecentchanges-param-hideanons',
182 'hidepatrolled' =>
false,
183 'hidemyself' =>
false,
184 'hidecategorization' =>
false,
187 ParamValidator::PARAM_TYPE =>
'string',
189 'inverttags' =>
false,
192 ParamValidator::PARAM_TYPE =>
'string',
194 'showlinkedto' =>
false,
201 'action=feedrecentchanges'
202 =>
'apihelp-feedrecentchanges-example-simple',
203 'action=feedrecentchanges&days=30'
204 =>
'apihelp-feedrecentchanges-example-30days',
210 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Feedrecentchanges';
215class_alias( ApiFeedRecentChanges::class,
'ApiFeedRecentChanges' );
wfEscapeWikiText( $input)
Escapes the given text so that it may be output using addWikiText() without any linking,...
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,...