46 parent::__construct( $mainModule, $moduleName );
68 if ( !$config->get(
'Feed' ) ) {
72 $feedClasses = $config->get(
'FeedClasses' );
73 if ( !isset( $feedClasses[$this->params[
'feedformat']] ) ) {
77 $this->
getMain()->setCacheMode(
'public' );
80 $this->
getMain()->setCacheMaxAge( 15 );
83 $feedFormat = $this->params[
'feedformat'];
84 $specialPageName = $this->params[
'target'] !==
null
85 ?
'Recentchangeslinked'
88 $formatter = $this->
getFeedObject( $feedFormat, $specialPageName );
99 $rc = $this->specialPageFactory->getPage( $specialPageName );
100 if ( $rc ===
null ) {
101 throw new RuntimeException( __METHOD__ .
' not able to instance special page ' . $specialPageName );
103 '@phan-var ChangesListSpecialPage $rc';
105 $rows = $rc->getRows();
121 if ( $specialPageName ===
'Recentchangeslinked' ) {
122 $title = Title::newFromText( $this->params[
'target'] );
128 $feedObj = $feed->getFeedObject(
129 $this->
msg(
'recentchangeslinked-title',
$title->getPrefixedText() )
130 ->inContentLanguage()->text(),
131 $this->msg(
'recentchangeslinked-feed' )->inContentLanguage()->text(),
136 $feedObj = $feed->getFeedObject(
137 $this->
msg(
'recentchanges' )->inContentLanguage()->text(),
138 $this->
msg(
'recentchanges-feed-description' )->inContentLanguage()->text(),
148 $feedFormatNames = array_keys( $config->get(
'FeedClasses' ) );
160 'associated' =>
false,
177 'hideminor' =>
false,
179 'hideanons' =>
false,
181 'hidepatrolled' =>
false,
182 'hidemyself' =>
false,
183 'hidecategorization' =>
false,
192 'showlinkedto' =>
false,
200 'action=feedrecentchanges'
201 =>
'apihelp-feedrecentchanges-example-simple',
202 'action=feedrecentchanges&days=30'
203 =>
'apihelp-feedrecentchanges-example-30days',
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
This abstract class implements many basic API functions, and is the base of all API classes.
dieWithError( $msg, $code=null, $data=null, $httpCode=0)
Abort execution with an error.
getParameter( $paramName, $parseLimit=true)
Get a value for the given parameter.
getMain()
Get the main module.
getResult()
Get the result object.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getFeedObject( $feedFormat, $specialPageName)
Return a ChannelFeed object.
__construct(ApiMain $mainModule, string $moduleName, SpecialPageFactory $specialPageFactory)
SpecialPageFactory $specialPageFactory
getExamplesMessages()
Returns usage examples for this module.
execute()
Format the rows (generated by SpecialRecentchanges or SpecialRecentchangeslinked) as an RSS/Atom feed...
getCustomPrinter()
This module uses a custom feed wrapper printer.
This is the main API class, used for both external and internal processing.
Feed to Special:RecentChanges and Special:RecentChangesLinked.
static buildItems( $rows)
Generate the feed items given a row from the database.
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 ...
Similar to FauxRequest, but only fakes URL parameters and method (POST or GET) and use the base reque...
Factory for handling the special page list and generating SpecialPage objects.
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,...