47 $this->revisionStore = MediaWikiServices::getInstance()->getRevisionStore();
52 if ( !$config->get(
'Feed' ) ) {
56 $feedClasses = $config->get(
'FeedClasses' );
57 if ( !isset( $feedClasses[
$params[
'feedformat']] ) ) {
61 if ( $params[
'showsizediff'] && $this->
getConfig()->
get(
'MiserMode' ) ) {
65 $msg =
wfMessage(
'Contributions' )->inContentLanguage()->text();
66 $feedTitle = $config->get(
'Sitename' ) .
' - ' . $msg .
67 ' [' . $config->get(
'LanguageCode' ) .
']';
68 $feedUrl = SpecialPage::getTitleFor(
'Contributions',
$params[
'user'] )->getFullURL();
70 $target =
$params[
'user'] ==
'newbies'
74 $feed =
new $feedClasses[
$params[
'feedformat']] (
76 htmlspecialchars( $msg ),
87 'namespace' =>
$params[
'namespace'],
90 'tagFilter' =>
$params[
'tagfilter'],
91 'deletedOnly' =>
$params[
'deletedonly'],
92 'topOnly' =>
$params[
'toponly'],
93 'newOnly' =>
$params[
'newonly'],
94 'hideMinor' =>
$params[
'hideminor'],
95 'showSizeDiff' =>
$params[
'showsizediff'],
98 $feedLimit = $this->
getConfig()->get(
'FeedLimit' );
99 if ( $pager->getLimit() > $feedLimit ) {
100 $pager->setLimit( $feedLimit );
104 if ( $pager->getNumRows() > 0 ) {
106 $limit = $pager->getLimit();
107 foreach ( $pager->mResult
as $row ) {
109 if ( ++$count > $limit ) {
113 if ( $item !==
null ) {
114 $feedItems[] = $item;
127 $hookResult = Hooks::run(
128 'ApiFeedContributions::feedItem',
132 if ( $feedItem instanceof
FeedItem ) {
135 } elseif ( !$hookResult ) {
140 $title = Title::makeTitle( intval( $row->page_namespace ), $row->page_title );
141 if (
$title &&
$title->userCan(
'read', $this->getUser() ) ) {
142 $date = $row->rev_timestamp;
143 $comments =
$title->getTalkPage()->getFullURL();
144 $revision = $this->revisionStore->newRevisionFromRow( $row );
147 $title->getPrefixedText(),
148 $this->feedItemDesc( $revision ),
149 $title->getFullURL( [
'diff' => $revision->getId() ] ),
151 $this->feedItemAuthor( $revision ),
176 $msg =
wfMessage(
'colon-separator' )->inContentLanguage()->text();
185 $html = nl2br( htmlspecialchars(
$content->getNativeData() ) );
196 return '<p>' . htmlspecialchars( $this->
feedItemAuthor( $revision ) ) . $msg .
198 "</p>\n<hr />\n<div>" .
$html .
'</div>';
205 $feedFormatNames = array_keys( $this->
getConfig()->
get(
'FeedClasses' ) );
230 'deletedonly' =>
false,
233 'hideminor' =>
false,
239 if ( $this->
getConfig()->
get(
'MiserMode' ) ) {
248 'action=feedcontributions&user=Example'
249 =>
'apihelp-feedcontributions-example-simple',
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
This abstract class implements many basic API functions, and is the base of all API classes.
const PARAM_REQUIRED
(boolean) Is the parameter required?
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
getMain()
Get the main module.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
getResult()
Get the result object.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
feedItemDesc(RevisionRecord $revision)
feedItemAuthor(RevisionRecord $revision)
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getCustomPrinter()
This module uses a custom feed wrapper printer.
RevisionStore $revisionStore
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
getExamplesMessages()
Returns usage examples for this module.
getContext()
Get the base IContextSource object.
A base class for basic support for outputting syndication feeds in RSS and other formats.
static stripComment( $text)
Quickie hack... strip out wikilinks to more legible form from the comment.
Content object implementation for representing flat text.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
namespace and then decline to actually register it file or subcat img or subcat $title
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
returning false will NOT prevent logging $e
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php