45 if ( !$config->get(
'Feed' ) ) {
46 $this->
dieUsage(
'Syndication feeds are not available',
'feed-unavailable' );
49 $feedClasses = $config->get(
'FeedClasses' );
50 if ( !isset( $feedClasses[
$params[
'feedformat']] ) ) {
51 $this->
dieUsage(
'Invalid subscription feed type',
'feed-invalid' );
54 if ( $params[
'showsizediff'] && $this->
getConfig()->
get(
'MiserMode' ) ) {
55 $this->
dieUsage(
'Size difference is disabled in Miser Mode',
'sizediffdisabled' );
58 $msg =
wfMessage(
'Contributions' )->inContentLanguage()->text();
59 $feedTitle = $config->get(
'Sitename' ) .
' - ' . $msg .
60 ' [' . $config->get(
'LanguageCode' ) .
']';
63 $target = $params[
'user'] ==
'newbies'
67 $feed =
new $feedClasses[$params[
'feedformat']] (
69 htmlspecialchars( $msg ),
75 'namespace' => $params[
'namespace'],
76 'year' => $params[
'year'],
77 'month' => $params[
'month'],
78 'tagFilter' => $params[
'tagfilter'],
79 'deletedOnly' => $params[
'deletedonly'],
80 'topOnly' => $params[
'toponly'],
81 'newOnly' => $params[
'newonly'],
82 'hideMinor' => $params[
'hideminor'],
83 'showSizeDiff' => $params[
'showsizediff'],
86 $feedLimit = $this->
getConfig()->get(
'FeedLimit' );
87 if ( $pager->getLimit() > $feedLimit ) {
88 $pager->setLimit( $feedLimit );
92 if ( $pager->getNumRows() > 0 ) {
94 $limit = $pager->getLimit();
95 foreach ( $pager->mResult
as $row ) {
101 if ( $item !== null ) {
102 $feedItems[] = $item;
116 'ApiFeedContributions::feedItem',
120 if ( $feedItem instanceof
FeedItem ) {
123 } elseif ( !$hookResult ) {
129 if (
$title &&
$title->userCan(
'read', $this->getUser() ) ) {
130 $date = $row->rev_timestamp;
131 $comments =
$title->getTalkPage()->getFullURL();
135 $title->getPrefixedText(),
137 $title->getFullURL( [
'diff' => $revision->getId() ] ),
152 return $revision->getUserText();
161 $msg =
wfMessage(
'colon-separator' )->inContentLanguage()->text();
166 $html = nl2br( htmlspecialchars(
$content->getNativeData() ) );
175 return '<p>' . htmlspecialchars( $revision->getUserText() ) . $msg .
177 "</p>\n<hr />\n<div>" .
$html .
'</div>';
184 $feedFormatNames = array_keys( $this->
getConfig()->
get(
'FeedClasses' ) );
209 'deletedonly' =>
false,
212 'hideminor' =>
false,
218 if ( $this->
getConfig()->
get(
'MiserMode' ) ) {
227 'action=feedcontributions&user=Example'
228 =>
'apihelp-feedcontributions-example-simple',
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below...
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
getResult()
Get the result object.
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
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...
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
getMain()
Get the main module.
const PARAM_REQUIRED
(boolean) Is the parameter required?
extractRequestParams($parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user...
static stripComment($text)
Quickie hack...
Content object implementation for representing flat text.
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 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 unsetoffset-wrap String Wrap the message in html(usually something like"<
getConfig()
Get the Config object.
getContext()
Get the base IContextSource object.
static makeTitleSafe($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
namespace and then decline to actually register it file or subcat img or subcat $title
feedItemAuthor($revision)
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
A base class for basic support for outputting syndication feeds in RSS and other formats.
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
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter...
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
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
dieUsage($description, $errorCode, $httpRespCode=0, $extradata=null)
Throw a UsageException, which will (if uncaught) call the main module's error handler and die with an...
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive $limit
This abstract class implements many basic API functions, and is the base of all API classes...
getCustomPrinter()
This module uses a custom feed wrapper printer.
static makeTitle($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.