49 parent::__construct( $mainModule, $moduleName );
50 $this->specialPageFactory = $specialPageFactory;
51 $this->tempUserConfig = $tempUserConfig;
77 '@phan-var array<string,class-string<ChannelFeed>> $feedClasses';
78 if ( !isset( $feedClasses[$this->params[
'feedformat']] ) ) {
82 $this->
getMain()->setCacheMode(
'public' );
85 $this->
getMain()->setCacheMaxAge( 15 );
88 $feedFormat = $this->params[
'feedformat'];
89 $specialPageName = $this->params[
'target'] !==
null
90 ?
'Recentchangeslinked'
93 $formatter = $this->getFeedObject( $feedFormat, $specialPageName );
104 $rc = $this->specialPageFactory->getPage( $specialPageName );
105 if ( $rc ===
null ) {
106 throw new RuntimeException( __METHOD__ .
' not able to instance special page ' . $specialPageName );
108 '@phan-var \MediaWiki\SpecialPage\ChangesListSpecialPage $rc';
109 $rc->setContext( $context );
110 $rows = $rc->getRows();
125 private function getFeedObject( $feedFormat, $specialPageName ) {
126 if ( $specialPageName ===
'Recentchangeslinked' ) {
127 $title = Title::newFromText( $this->params[
'target'] );
128 if ( !$title || $title->isExternal() ) {
132 $feed =
new ChangesFeed( $feedFormat );
133 $feedObj = $feed->getFeedObject(
134 $this->
msg(
'recentchangeslinked-title', $title->getPrefixedText() )
135 ->inContentLanguage()->text(),
136 $this->msg(
'recentchangeslinked-feed' )->inContentLanguage()->text(),
140 $feed =
new ChangesFeed( $feedFormat );
141 $feedObj = $feed->getFeedObject(
142 $this->
msg(
'recentchanges' )->inContentLanguage()->text(),
143 $this->
msg(
'recentchanges-feed-description' )->inContentLanguage()->text(),
158 ParamValidator::PARAM_DEFAULT =>
'rss',
159 ParamValidator::PARAM_TYPE => $feedFormatNames,
163 ParamValidator::PARAM_TYPE =>
'namespace',
167 'associated' =>
false,
170 ParamValidator::PARAM_DEFAULT => 7,
171 IntegerDef::PARAM_MIN => 1,
172 ParamValidator::PARAM_TYPE =>
'integer',
175 ParamValidator::PARAM_DEFAULT => 50,
176 IntegerDef::PARAM_MIN => 1,
178 ParamValidator::PARAM_TYPE =>
'integer',
181 ParamValidator::PARAM_TYPE =>
'timestamp',
184 'hideminor' =>
false,
187 ParamValidator::PARAM_DEFAULT =>
false,
189 'apihelp-feedrecentchanges-param-hideanons-temp' :
190 'apihelp-feedrecentchanges-param-hideanons',
193 'hidepatrolled' =>
false,
194 'hidemyself' =>
false,
195 'hidecategorization' =>
false,
198 ParamValidator::PARAM_TYPE =>
'string',
200 'inverttags' =>
false,
203 ParamValidator::PARAM_TYPE =>
'string',
205 'showlinkedto' =>
false,
212 'action=feedrecentchanges'
213 =>
'apihelp-feedrecentchanges-example-simple',
214 'action=feedrecentchanges&days=30'
215 =>
'apihelp-feedrecentchanges-example-30days',
221 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Feedrecentchanges';
226class_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,...