58 return $this->
msg(
'history-title', $this->
getTitle()->getPrefixedText() )->text();
63 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
65 SpecialPage::getTitleFor(
'Log' ),
66 $this->
msg(
'viewpagelogs' )->
text(),
68 [
'page' => $this->
getTitle()->getPrefixedText() ]
76 . $this->
msg(
'word-separator' )->escaped()
77 . $this->
msg(
'parentheses' )
78 ->rawParams( $this->
getLanguage()->pipeList( $links ) )
81 return Html::rawElement(
'div', [
'class' =>
'mw-history-subtitle' ], $subtitle );
97 if ( !isset( $this->
message ) ) {
98 $msgs = [
'cur',
'last',
'pipe-separator' ];
99 foreach ( $msgs
as $msg ) {
100 $this->
message[$msg] = $this->
msg( $msg )->escaped();
115 if (
$out->checkLastModified( $this->page->getTouched() ) ) {
120 $config = $this->context->getConfig();
122 # Fill in the file cache if not set already
125 if ( !
$cache->isCacheGood( ) ) {
126 ob_start( [ &
$cache,
'saveToFileCache' ] );
131 $out->setFeedAppendQuery(
'action=history' );
132 $out->addModules(
'mediawiki.action.history' );
133 $out->addModuleStyles( [
134 'mediawiki.interface.helpers.styles',
135 'mediawiki.action.history.styles',
136 'mediawiki.special.changeslist',
138 if ( $config->get(
'UseMediaWikiUIEverywhere' ) ) {
140 $out->addModuleStyles( [
141 'mediawiki.ui.input',
142 'mediawiki.ui.checkbox',
147 $feedType =
$request->getVal(
'feed' );
149 $this->
feed( $feedType );
154 $this->
addHelpLink(
'//meta.wikimedia.org/wiki/Special:MyLanguage/Help:Page_history',
true );
157 if ( !$this->
page->exists() ) {
160 $out->setStatusCode( 404 );
162 $out->addWikiMsg(
'nohistory' );
166 # show deletion/move log if there is an entry
169 [
'delete',
'move',
'protect' ],
173 'conds' => [
'log_action != ' .
$dbr->addQuotes(
'revision' ) ],
174 'showIfEmpty' =>
false,
175 'msgKey' => [
'moveddeleted-notice' ]
186 $month =
$request->getInt(
'month' );
187 $tagFilter =
$request->getVal(
'tagfilter' );
193 if (
$request->getBool(
'deleted' ) ) {
194 $conds = [
'rev_deleted != 0' ];
198 if ( $this->
getUser()->isAllowed(
'deletedhistory' ) ) {
199 $checkDeleted = Xml::checkLabel( $this->
msg(
'history-show-deleted' )->
text(),
200 'deleted',
'mw-show-deleted-only',
$request->getBool(
'deleted' ) ) .
"\n";
206 $action = htmlspecialchars(
wfScript() );
207 $content = Html::hidden(
'title', $this->
getTitle()->getPrefixedDBkey() ) .
"\n";
208 $content .= Html::hidden(
'action',
'history' ) .
"\n";
210 ( $year ==
null ? MWTimestamp::getLocalInstance()->
format(
'Y' ) : $year ),
213 $content .= $tagSelector ? ( implode(
"\u{00A0}", $tagSelector ) .
"\u{00A0}" ) :
'';
214 $content .= $checkDeleted . Html::submitButton(
215 $this->
msg(
'historyaction-submit' )->
text(),
217 [
'mw-ui-progressive' ]
220 "<form action=\"$action\" method=\"get\" id=\"mw-history-searchform\">" .
222 $this->
msg(
'history-fieldset-title' )->
text(),
224 [
'id' =>
'mw-history-search' ]
229 Hooks::run(
'PageHistoryBeforeList', [ &$this->
page, $this->
getContext() ] );
232 $pager =
new HistoryPager( $this, $year, $month, $tagFilter, $conds );
234 $pager->getNavigationBar() .
236 $pager->getNavigationBar()
238 $out->preventClickjacking( $pager->getPreventClickjacking() );
259 if ( $direction === self::DIR_PREV ) {
260 list( $dirs, $oper ) = [
"ASC",
">=" ];
262 list( $dirs, $oper ) = [
"DESC",
"<=" ];
266 $offsets = [
"rev_timestamp $oper " .
$dbr->addQuotes(
$dbr->timestamp( $offset ) ) ];
271 $page_id = $this->
page->getId();
277 array_merge( [
'rev_page' => $page_id ], $offsets ),
280 'ORDER BY' =>
"rev_timestamp $dirs",
281 'USE INDEX' => [
'revision' =>
'page_timestamp' ],
299 $feedClasses = $this->context->getConfig()->get(
'FeedClasses' );
301 $feed =
new $feedClasses[
$type](
302 $this->
getTitle()->getPrefixedText() .
' - ' .
303 $this->
msg(
'history-feed-title' )->inContentLanguage()->text(),
304 $this->
msg(
'history-feed-description' )->inContentLanguage()->text(),
305 $this->
getTitle()->getFullURL(
'action=history' )
310 $limit =
$request->getInt(
'limit', 10 );
313 $this->context->getConfig()->get(
'FeedLimit' )
320 if ( $items->numRows() ) {
321 foreach ( $items
as $row ) {
322 $feed->outItem( $this->
feedItem( $row ) );
332 $this->
msg(
'nohistory' )->inContentLanguage()->
text(),
333 $this->
msg(
'history-feed-empty' )->inContentLanguage()->parseAsBlock(),
337 $this->
getTitle()->getTalkPage()->getFullURL()
354 $this->
getTitle()->getPreviousRevisionID(
$rev->getId() ),
356 $rev->getTimestamp(),
359 if (
$rev->getComment() ==
'' ) {
360 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
361 $title = $this->
msg(
'history-feed-item-nocomment',
363 $contLang->timeanddate(
$rev->getTimestamp() ),
364 $contLang->date(
$rev->getTimestamp() ),
365 $contLang->time(
$rev->getTimestamp() )
366 )->inContentLanguage()->text();
369 $this->
msg(
'colon-separator' )->inContentLanguage()->text() .
376 $this->
getTitle()->getFullURL(
'diff=' .
$rev->getId() .
'&oldid=prev' ),
377 $rev->getTimestamp(),
379 $this->getTitle()->getTalkPage()->getFullURL()
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
$wgSend404Code
Some web hosts attempt to rewrite all responses with a 404 (not found) status code,...
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
$page
Page on which we're performing the action.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
getTitle()
Shortcut to get the Title object from the page.
getContext()
Get the IContextSource in use here.
getOutput()
Get the OutputPage being used for this instance.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getUser()
Shortcut to get the User being used for this instance.
static exists( $name)
Check if a given action is recognised, even if it's disabled.
getLanguage()
Shortcut to get the user Language being used for this instance.
getRequest()
Get the WebRequest being used for this instance.
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.
static checkFeedOutput( $type)
Check whether feeds can be used and that $type is a valid feed type.
static formatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiontext='')
Really format a diff for the newsfeed.
Page view caching in the file system.
static useFileCache(IContextSource $context, $mode=self::MODE_NORMAL)
Check if pages can be cached for this request/user.
This class handles printing the history page for an article.
onView()
Print the history page for an article.
feed( $type)
Output a subscription feed listing recent edits to this page.
preCacheMessages()
As we use the same small set of messages in various methods and that they are called often,...
array $message
Array of message keys and strings.
getName()
Return the name of the action this object responds to.
requiresWrite()
Whether this action requires the wiki not to be locked.
getPageTitle()
Returns the name that goes in the <h1> page title.
fetchRevisions( $limit, $offset, $direction)
Fetch an array of revisions, specified by a given limit, offset and direction.
feedItem( $row)
Generate a FeedItem object from a given revision table row Borrows Recent Changes' feed generation fu...
getDescription()
Returns the description that goes below the <h1> tag.
requiresUnblock()
Whether this action can still be executed by a blocked user.
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
static getQueryInfo( $options=[])
Return the tables, fields, and join conditions to be selected to create a new revision object.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
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
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
namespace and then decline to actually register it file or subcat img or subcat $title
if the prop value should be in the metadata multi language array format
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 message
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 after processing after in associative array form before processing starts Return false to skip default processing and return $ret $linkRenderer
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
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
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))