Go to the documentation of this file.
50 $this->revisionStore = MediaWikiServices::getInstance()->getRevisionStore();
51 $this->titleParser = MediaWikiServices::getInstance()->getTitleParser();
56 if ( !$config->get(
'Feed' ) ) {
60 $feedClasses = $config->get(
'FeedClasses' );
61 if ( !isset( $feedClasses[$params[
'feedformat']] ) ) {
65 if ( $params[
'showsizediff'] && $this->
getConfig()->
get(
'MiserMode' ) ) {
69 $msg =
wfMessage(
'Contributions' )->inContentLanguage()->text();
70 $feedTitle = $config->get(
'Sitename' ) .
' - ' . $msg .
71 ' [' . $config->get(
'LanguageCode' ) .
']';
75 $target = $this->titleParser
76 ->parseTitle( $params[
'user'],
NS_USER )
85 $feed =
new $feedClasses[$params[
'feedformat']] (
87 htmlspecialchars( $msg ),
92 $params[
'start'] =
'';
98 'namespace' => $params[
'namespace'],
99 'start' => $params[
'start'],
100 'end' => $params[
'end'],
101 'tagFilter' => $params[
'tagfilter'],
102 'deletedOnly' => $params[
'deletedonly'],
103 'topOnly' => $params[
'toponly'],
104 'newOnly' => $params[
'newonly'],
105 'hideMinor' => $params[
'hideminor'],
106 'showSizeDiff' => $params[
'showsizediff'],
109 $feedLimit = $this->
getConfig()->get(
'FeedLimit' );
110 if ( $pager->getLimit() > $feedLimit ) {
111 $pager->setLimit( $feedLimit );
115 if ( $pager->getNumRows() > 0 ) {
117 $limit = $pager->getLimit();
118 foreach ( $pager->mResult as $row ) {
120 if ( ++$count > $limit ) {
124 if ( $item !==
null ) {
125 $feedItems[] = $item;
139 'ApiFeedContributions::feedItem',
143 if ( $feedItem instanceof
FeedItem ) {
146 } elseif ( !$hookResult ) {
155 $date = $row->rev_timestamp;
156 $comments =
$title->getTalkPage()->getFullURL();
157 $revision = $this->revisionStore->newRevisionFromRow( $row );
160 $title->getPrefixedText(),
162 $title->getFullURL( [
'diff' => $revision->getId() ] ),
179 return $user ? $user->getName() :
'';
188 $msg =
wfMessage(
'colon-separator' )->inContentLanguage()->text();
197 $html = nl2br( htmlspecialchars(
$content->getText() ) );
208 return '<p>' . htmlspecialchars( $this->
feedItemAuthor( $revision ) ) . $msg .
210 "</p>\n<hr />\n<div>" . $html .
'</div>';
214 $feedFormatNames = array_keys( $this->
getConfig()->
get(
'FeedClasses' ) );
239 'deletedonly' =>
false,
242 'hideminor' =>
false,
248 if ( $this->
getConfig()->
get(
'MiserMode' ) ) {
257 'action=feedcontributions&user=Example'
258 =>
'apihelp-feedcontributions-example-simple',
A base class for outputting syndication feeds (e.g.
getContext()
Get the base IContextSource object.
const PARAM_REQUIRED
(boolean) Is the parameter required?
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
getCustomPrinter()
This module uses a custom feed wrapper printer.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
getResult()
Get the result object.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
static stripComment( $text)
Quickie hack...
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
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,...
This abstract class implements many basic API functions, and is the base of all API classes.
feedItemAuthor(RevisionRecord $revision)
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
A title parser service for MediaWiki.
RevisionStore $revisionStore
encodeParamName( $paramName)
This method mangles parameter name based on the prefix supplied to the constructor.
getPermissionManager()
Obtain a PermissionManager instance that subclasses may use in their authorization checks.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Content object implementation for representing flat text.
feedItemDesc(RevisionRecord $revision)
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
getMain()
Get the main module.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getExamplesMessages()
Returns usage examples for this module.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.