MediaWiki
master
|
Class for viewing MediaWiki article and history. More...
Public Member Functions | |
__construct (Title $title, $oldId=null) | |
__get ( $fname) | |
__set ( $fname, $fvalue) | |
addHelpLink ( $to, $overrideBaseUrl=false) | |
Adds help link with an icon via page indicators. More... | |
adjustDisplayTitle (ParserOutput $pOutput) | |
Adjust title for pages with displaytitle, -{T|}- or language conversion. More... | |
checkFlags ( $flags) | |
Call to WikiPage function for backwards compatibility. More... | |
checkTouched () | |
clear () | |
clearPreparedEdit () | |
Call to WikiPage function for backwards compatibility. More... | |
commitRollback ( $fromP, $summary, $bot, &$resultDetails, User $guser=null) | |
confirmDelete ( $reason) | |
Output deletion confirmation dialog. More... | |
delete () | |
UI entry point for page deletion. More... | |
doDelete ( $reason, $suppress=false, $immediate=false) | |
Perform a deletion and output success or failure messages. More... | |
doDeleteUpdates ( $id, Content $content=null, $revision=null, User $user=null) | |
doEditUpdates (Revision $revision, User $user, array $options=[]) | |
Call to WikiPage function for backwards compatibility. More... | |
doPurge () | |
doRollback ( $fromP, $summary, $token, $bot, &$resultDetails, User $user=null) | |
doUpdateRestrictions (array $limit, array $expiry, &$cascade, $reason, User $user) | |
doViewUpdates (User $user, $oldid=0) | |
exists () | |
fetchRevisionRecord () | |
Fetches the revision to work on. More... | |
followRedirect () | |
generateReason (&$hasHistory) | |
getActionOverrides () | |
Call to WikiPage function for backwards compatibility. More... | |
getAutoDeleteReason (&$hasHistory) | |
getCategories () | |
getContentHandler () | |
getContentModel () | |
getContext () | |
Gets the context this Article is executed in. More... | |
getContributors () | |
getDeletionUpdates (Content $content=null) | |
getHiddenCategories () | |
getId () | |
getLatest () | |
getLinksTimestamp () | |
getMinorEdit () | |
getOldestRevision () | |
getOldID () | |
getOldIDFromRequest () | |
Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect. More... | |
getPage () | |
Get the WikiPage object of this instance. More... | |
getParserOptions () | |
Get parser options suitable for rendering the primary article wikitext. More... | |
getParserOutput ( $oldid=null, User $user=null) | |
#- More... | |
getRedirectedFrom () | |
Get the page this view was redirected from. More... | |
getRedirectTarget () | |
getRedirectURL ( $rt) | |
getRevIdFetched () | |
Use this to fetch the rev ID used on page views. More... | |
getRevision () | |
Call to WikiPage function for backwards compatibility. More... | |
getRevisionFetched () | |
Get the fetched Revision object depending on request parameters or null on failure. More... | |
getRobotPolicy ( $action, ParserOutput $pOutput=null) | |
Get the robot policy to be used for the current view. More... | |
getTimestamp () | |
getTitle () | |
Get the title object of the article. More... | |
getTouched () | |
getUndoContent (Revision $undo, Revision $undoafter=null) | |
Call to WikiPage function for backwards compatibility. More... | |
hasViewableContent () | |
insertOn ( $dbw, $pageId=null) | |
insertRedirect () | |
insertRedirectEntry (Title $rt, $oldLatest=null) | |
isCountable ( $editInfo=false) | |
isCurrent () | |
Returns true if the currently-referenced revision is the current edit to this page (and it exists). More... | |
isFileCacheable ( $mode=HTMLFileCache::MODE_NORMAL) | |
Check if the page can be cached. More... | |
isRedirect () | |
loadFromRow ( $data, $from) | |
loadPageData ( $from='fromdb') | |
lockAndGetLatest () | |
makeParserOptions ( $context) | |
pageDataFromId ( $dbr, $id, $options=[]) | |
pageDataFromTitle ( $dbr, $title, $options=[]) | |
prepareContentForEdit (Content $content, $revision=null, User $user=null, $serialFormat=null, $useCache=true) | |
Call to WikiPage function for backwards compatibility. More... | |
protect () | |
action=protect handler More... | |
protectDescription (array $limit, array $expiry) | |
protectDescriptionLog (array $limit, array $expiry) | |
render () | |
Handle action=render. More... | |
replaceSectionAtRev ( $sectionId, Content $sectionContent, $sectionTitle='', $baseRevId=null) | |
replaceSectionContent ( $sectionId, Content $sectionContent, $sectionTitle='', $edittime=null) | |
Call to WikiPage function for backwards compatibility. More... | |
setContext ( $context) | |
Sets the context this Article is executed in. More... | |
setOldSubtitle ( $oldid=0) | |
Generate the navigation links when browsing through an article revisions It shows the information as: Revision as of \<date\>; view current revision \<- Previous version | Next Version -\> More... | |
setRedirectedFrom (Title $from) | |
Tell the page view functions that this view was redirected from another page on the wiki. More... | |
setTimestamp ( $ts) | |
shouldCheckParserCache (ParserOptions $parserOptions, $oldId) | |
showDeletedRevisionHeader () | |
If the revision requested for view is deleted, check permissions. More... | |
showMissingArticle () | |
Show the error text for a missing article. More... | |
showNamespaceHeader () | |
Show a header specific to the namespace currently being viewed, like [[MediaWiki:Talkpagetext]]. More... | |
showPatrolFooter () | |
If patrol is possible, output a patrol UI box. More... | |
showRedirectedFromHeader () | |
If this request is a redirect view, send "redirected from" subtitle to the output. More... | |
showViewFooter () | |
Show the footer section of an ordinary page view. More... | |
supportsSections () | |
triggerOpportunisticLinksUpdate (ParserOutput $parserOutput) | |
unprotect () | |
action=unprotect handler (alias) More... | |
updateCategoryCounts (array $added, array $deleted, $id=0) | |
updateIfNewerOn ( $dbw, $revision) | |
Call to WikiPage function for backwards compatibility. More... | |
updateRedirectOn ( $dbw, $redirectTitle, $lastRevIsRedirect=null) | |
updateRestrictions ( $limit=[], $reason='', &$cascade=0, $expiry=[]) | |
updateRevisionOn ( $dbw, $revision, $lastRevision=null, $lastRevIsRedirect=null) | |
view () | |
This is the default action of the index.php entry point: just view the page of the given title. More... | |
viewRedirect ( $target, $appendSubtitle=true, $forceKnown=false) | |
Return the HTML for the top of a redirect page. More... | |
Static Public Member Functions | |
static | formatRobotPolicy ( $policy) |
Converts a String robot policy into an associative array, to allow merging of several policies using array_merge(). More... | |
static | getRedirectHeaderHtml (Language $lang, $target, $forceKnown=false) |
Return the HTML for the top of a redirect page. More... | |
static | newFromID ( $id) |
Constructor from a page id. More... | |
static | newFromTitle ( $title, IContextSource $context) |
Create an Article object of the appropriate class for the given page. More... | |
static | newFromWikiPage (WikiPage $page, IContextSource $context) |
Create an Article object of the appropriate class for the given page. More... | |
static | purgePatrolFooterCache ( $articleID) |
Purge the cache used to check if it is worth showing the patrol footer For example, it is done during re-uploads when file patrol is used. More... | |
Public Attributes | |
int null | $mOldId |
The oldid of the article that was requested to be shown, 0 for the current revision. More... | |
ParserOutput null false | $mParserOutput = null |
The ParserOutput generated for viewing the page, initialized by view(). More... | |
Title null | $mRedirectedFrom = null |
Title from which we were redirected here, if any. More... | |
string bool | $mRedirectUrl = false |
URL to redirect to or false if none. More... | |
Protected Member Functions | |
getContentObject () | |
Returns a Content object representing the pages effective display content, not necessarily the revision's content! More... | |
newPage (Title $title) | |
showDiffPage () | |
Show a diff page according to current request variables. More... | |
tryFileCache () | |
checkLastModified returns true if it has taken care of all output to the client that is necessary for this request. More... | |
Protected Attributes | |
LinkRenderer | $linkRenderer |
IContextSource null | $mContext |
The context this Article is executed in. More... | |
WikiPage | $mPage |
The WikiPage object of this instance. More... | |
bool | $viewIsRenderAction = false |
Whether render() was called. More... | |
Private Member Functions | |
doOutputFromParserCache (ParserOutput $pOutput, OutputPage $outputPage, array $textOptions) | |
doOutputFromRenderStatus (?RevisionRecord $rev, Status $renderStatus, OutputPage $outputPage, array $textOptions) | |
doOutputMetaData (?ParserOutput $pOutput, OutputPage $outputPage) | |
generateContentOutput (User $user, ParserOptions $parserOptions, int $oldid, OutputPage $outputPage, array $textOptions) | |
Determines the desired ParserOutput and passes it to $outputPage. More... | |
getRevisionRedirectTarget (RevisionRecord $revision) | |
getSubstituteContent () | |
Returns Content object to use when the page does not exist. More... | |
showViewError (string $errortext) | |
Show error text for errors generated in Article::view(). More... | |
Private Attributes | |
Status null | $fetchResult = null |
represents the outcome of fetchRevisionRecord(). More... | |
RevisionRecord null | $mRevisionRecord = null |
Revision to be shown. More... | |
PermissionManager | $permManager |
RevisionStore | $revisionStore |
Class for viewing MediaWiki article and history.
This maintains WikiPage functions for backwards compatibility.
Note: edit user interface and cache support functions have been moved to separate EditPage and HTMLFileCache classes.
Definition at line 47 of file Article.php.
Article::__construct | ( | Title | $title, |
$oldId = null |
|||
) |
Definition at line 123 of file Article.php.
References newPage().
Article::__get | ( | $fname | ) |
Use PHP's magic __get handler to handle accessing of raw WikiPage fields for backwards compatibility, as well as the deprecated $mRevision
string | $fname | Field name |
Definition at line 2359 of file Article.php.
References fetchRevisionRecord(), and wfDeprecatedMsg().
Article::__set | ( | $fname, | |
$fvalue | |||
) |
Use PHP's magic __set handler to handle setting of raw WikiPage fields for backwards compatibility, as well as the deprecated $mRevision
string | $fname | Field name |
mixed | $fvalue | New value |
Definition at line 2383 of file Article.php.
References wfDeprecatedMsg().
Article::addHelpLink | ( | $to, | |
$overrideBaseUrl = false |
|||
) |
Adds help link with an icon via page indicators.
Link target can be overridden by a local message containing a wikilink: the message key is: 'namespace-' + namespace number + '-helppage'.
string | $to | Target MediaWiki.org page title or encoded URL. |
bool | $overrideBaseUrl | Whether $url is a full URL, to avoid MW.o. |
Definition at line 1816 of file Article.php.
References $title, getContext(), getTitle(), and Title\newFromText().
Referenced by CategoryPage\closeShowCategory().
Article::adjustDisplayTitle | ( | ParserOutput | $pOutput | ) |
Adjust title for pages with displaytitle, -{T|}- or language conversion.
ParserOutput | $pOutput |
Definition at line 882 of file Article.php.
References getContext(), and ParserOutput\getTitleText().
Referenced by doOutputMetaData().
Article::checkFlags | ( | $flags | ) |
Call to WikiPage function for backwards compatibility.
int | $flags |
Definition at line 2415 of file Article.php.
References wfDeprecated().
Article::checkTouched | ( | ) |
Definition at line 2425 of file Article.php.
References wfDeprecated().
Article::clear | ( | ) |
Definition at line 233 of file Article.php.
Article::clearPreparedEdit | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2435 of file Article.php.
References wfDeprecated().
Article::commitRollback | ( | $fromP, | |
$summary, | |||
$bot, | |||
& | $resultDetails, | ||
User | $guser = null |
||
) |
Definition at line 3100 of file Article.php.
References getContext(), and wfDeprecated().
Article::confirmDelete | ( | $reason | ) |
Output deletion confirmation dialog.
string | $reason | Prefilled reason |
Definition at line 1991 of file Article.php.
References $title, CommentStore\COMMENT_CHARACTER_LIMIT, Xml\element(), getContext(), getTitle(), Html\hidden(), Xml\listDropDownOptions(), Xml\listDropDownOptionsOoui(), Message\numParam(), LogEventsList\showLogExtract(), Html\warningBox(), wfDebug(), and wfMessage().
Referenced by delete().
Article::delete | ( | ) |
UI entry point for page deletion.
Reimplemented in ImagePage.
Definition at line 1859 of file Article.php.
References $dbr, $title, $wgDeleteRevisionsLimit, confirmDelete(), DB_REPLICA, doDelete(), WatchAction\doWatchOrUnwatch(), Xml\element(), getContext(), getPage(), getTitle(), LogEventsList\showLogExtract(), wfDebug(), wfEscapeWikiText(), wfGetDB(), wfMessage(), and wfReadOnly().
Article::doDelete | ( | $reason, | |
$suppress = false , |
|||
$immediate = false |
|||
) |
Perform a deletion and output success or failure messages.
string | $reason | |
bool | $suppress | |
bool | $immediate | false allows deleting over time via the job queue |
FatalError | |
MWException |
Definition at line 2188 of file Article.php.
References Xml\element(), getContext(), getTitle(), LogEventsList\showLogExtract(), wfEscapeWikiText(), and wfMessage().
Referenced by delete().
Definition at line 2448 of file Article.php.
References $content, and wfDeprecated().
Call to WikiPage function for backwards compatibility.
Definition at line 2467 of file Article.php.
References wfDeprecated().
|
private |
ParserOutput | $pOutput | |
OutputPage | $outputPage | |
array | $textOptions |
Definition at line 804 of file Article.php.
References OutputPage\addParserOutput(), CacheTime\getCacheRevisionId(), ParserOutput\getTimestamp(), OutputPage\setRevisionId(), and OutputPage\setRevisionTimestamp().
Referenced by generateContentOutput().
|
private |
RevisionRecord | null | $rev | |
Status | $renderStatus | |
OutputPage | $outputPage | |
array | $textOptions |
Definition at line 827 of file Article.php.
References $wgCdnMaxageStale, OutputPage\addHTML(), OutputPage\addParserOutput(), OutputPage\addSubtitle(), getContext(), getRevisionRedirectTarget(), StatusValue\getValue(), Status\getWikiText(), StatusValue\hasMessage(), StatusValue\isOK(), OutputPage\setCdnMaxage(), OutputPage\setLastModified(), and showViewError().
Referenced by generateContentOutput().
|
private |
?ParserOutput | $pOutput | |
OutputPage | $outputPage |
Definition at line 785 of file Article.php.
References adjustDisplayTitle(), getRobotPolicy(), OutputPage\setFollowPolicy(), and OutputPage\setIndexPolicy().
Referenced by generateContentOutput().
Article::doPurge | ( | ) |
Definition at line 2479 of file Article.php.
References wfDeprecated().
Article::doRollback | ( | $fromP, | |
$summary, | |||
$token, | |||
$bot, | |||
& | $resultDetails, | ||
User | $user = null |
||
) |
string | $fromP | |
string | $summary | |
string | $token | |
bool | $bot | |
array | &$resultDetails | |
User | null | $user |
Definition at line 3074 of file Article.php.
References getContext(), and wfDeprecated().
Article::doUpdateRestrictions | ( | array | $limit, |
array | $expiry, | ||
& | $cascade, | ||
$reason, | |||
User | $user | ||
) |
array | $limit | |
array | $expiry | |
bool | &$cascade | |
string | $reason | |
User | $user |
Definition at line 3036 of file Article.php.
References wfDeprecated().
Article::doViewUpdates | ( | User | $user, |
$oldid = 0 |
|||
) |
User | $user | |
int | $oldid |
Definition at line 2490 of file Article.php.
References wfDeprecated().
Article::exists | ( | ) |
Definition at line 2500 of file Article.php.
References wfDeprecated().
Referenced by ImagePage\imageHistory().
Article::fetchRevisionRecord | ( | ) |
Fetches the revision to work on.
The revision is loaded from the database. Refer to $this->fetchResult for the revision or any errors encountered while loading it.
Public since 1.35
Definition at line 391 of file Article.php.
References $mRevisionRecord, getOldID(), getTitle(), StatusValue\newFatal(), StatusValue\newGood(), and wfDebug().
Referenced by __get(), generateContentOutput(), getContentObject(), getRevisionFetched(), and showDiffPage().
Article::followRedirect | ( | ) |
Definition at line 2510 of file Article.php.
References wfDeprecated().
|
static |
Converts a String robot policy into an associative array, to allow merging of several policies using array_merge().
array | string | $policy | Returns empty array on null/false/'', transparent to already-converted arrays, converts string. |
Definition at line 1040 of file Article.php.
Referenced by getRobotPolicy(), and OutputPage\setRobotPolicy().
|
private |
Determines the desired ParserOutput and passes it to $outputPage.
User | $user | |
ParserOptions | $parserOptions | |
int | $oldid | |
OutputPage | $outputPage | |
array | $textOptions |
Definition at line 624 of file Article.php.
References $lang, doOutputFromParserCache(), doOutputFromRenderStatus(), doOutputMetaData(), fetchRevisionRecord(), getContext(), getPage(), getRevIdFetched(), getTitle(), setOldSubtitle(), OutputPage\setRevisionId(), OutputPage\setRevisionTimestamp(), showDeletedRevisionHeader(), showMissingArticle(), showViewError(), wfDebug(), and OutputPage\wrapWikiMsg().
Referenced by view().
Article::generateReason | ( | & | $hasHistory | ) |
bool | &$hasHistory |
Definition at line 3115 of file Article.php.
References getPage(), and wfDeprecated().
Article::getActionOverrides | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2520 of file Article.php.
Referenced by Action\factory().
Article::getAutoDeleteReason | ( | & | $hasHistory | ) |
bool | &$hasHistory |
Definition at line 2530 of file Article.php.
References wfDeprecated().
Article::getCategories | ( | ) |
Definition at line 2540 of file Article.php.
References wfDeprecated().
Article::getContentHandler | ( | ) |
Definition at line 2550 of file Article.php.
References wfDeprecated().
Article::getContentModel | ( | ) |
Definition at line 2560 of file Article.php.
References wfDeprecated().
|
protected |
Returns a Content object representing the pages effective display content, not necessarily the revision's content!
Note that getContent does not follow redirects anymore. If you need to fetch redirectable content easily, try the shortcut in WikiPage::getRedirectTarget()
This function has side effects! Do not use this function if you only want the real revision text if any.
Definition at line 261 of file Article.php.
References $content, fetchRevisionRecord(), getContext(), getSubstituteContent(), getUser(), and wfDeprecated().
Article::getContext | ( | ) |
Gets the context this Article is executed in.
Definition at line 2340 of file Article.php.
References $mContext, RequestContext\getMain(), and wfDebug().
Referenced by ImageHistoryList\__construct(), EditPage\__construct(), ProtectionForm\__construct(), addHelpLink(), adjustDisplayTitle(), CategoryPage\closeShowCategory(), commitRollback(), confirmDelete(), ImagePage\createXmlOptionStringForLanguage(), delete(), ImagePage\delete(), doDelete(), doOutputFromRenderStatus(), ImagePage\doRenderLangOpt(), doRollback(), generateContentOutput(), getContentObject(), getOldIDFromRequest(), getParserOptions(), getRobotPolicy(), getSubstituteContent(), ImagePage\getThumbPrevText(), ImagePage\getThumbSizes(), ImagePage\imageDupes(), ImagePage\imageHistory(), ImagePage\imageLinks(), isFileCacheable(), ImagePage\makeMetadataTable(), ImagePage\openShowImage(), ImagePage\printSharedImageText(), render(), setOldSubtitle(), showDeletedRevisionHeader(), showDiffPage(), ImagePage\showError(), showMissingArticle(), showNamespaceHeader(), showPatrolFooter(), showRedirectedFromHeader(), ImagePage\showTOC(), showViewError(), showViewFooter(), tryFileCache(), updateRestrictions(), ImagePage\uploadLinksBox(), view(), CategoryPage\view(), ImagePage\view(), and viewRedirect().
Article::getContributors | ( | ) |
Definition at line 2570 of file Article.php.
References wfDeprecated().
Article::getDeletionUpdates | ( | Content | $content = null | ) |
Content | null | $content |
Definition at line 2581 of file Article.php.
References $content, and wfDeprecated().
Article::getHiddenCategories | ( | ) |
Definition at line 2591 of file Article.php.
References wfDeprecated().
Article::getId | ( | ) |
Definition at line 2601 of file Article.php.
References wfDeprecated().
Referenced by ImagePage\openShowImage(), ImagePage\printSharedImageText(), and ImagePage\view().
Article::getLatest | ( | ) |
Definition at line 2611 of file Article.php.
References wfDeprecated().
Article::getLinksTimestamp | ( | ) |
Definition at line 2621 of file Article.php.
References wfDeprecated().
Article::getMinorEdit | ( | ) |
Definition at line 2631 of file Article.php.
References wfDeprecated().
Article::getOldestRevision | ( | ) |
Definition at line 2640 of file Article.php.
References wfDeprecated().
Article::getOldID | ( | ) |
Definition at line 309 of file Article.php.
References $mOldId, and getOldIDFromRequest().
Referenced by fetchRevisionRecord(), isCurrent(), showDeletedRevisionHeader(), showDiffPage(), showMissingArticle(), view(), and ImagePage\view().
Article::getOldIDFromRequest | ( | ) |
Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect.
Definition at line 322 of file Article.php.
References $mRevisionRecord, getContext(), Revision\RevisionRecord\getId(), and getTitle().
Referenced by getOldID().
Article::getPage | ( | ) |
Get the WikiPage object of this instance.
Definition at line 229 of file Article.php.
References $mPage.
Referenced by ImageHistoryList\__construct(), EditPage\__construct(), delete(), generateContentOutput(), generateReason(), ImagePage\getDuplicates(), ImagePage\getFile(), ImagePage\getForeignCategories(), ImagePage\imageDupes(), ImagePage\isLocal(), ImagePage\loadFile(), ImagePage\openShowImage(), ImagePage\printSharedImageText(), ImagePage\setFile(), CategoryPage\view(), and ImagePage\view().
Article::getParserOptions | ( | ) |
Get parser options suitable for rendering the primary article wikitext.
Definition at line 2320 of file Article.php.
References getContext().
Referenced by getParserOutput(), and view().
Article::getParserOutput | ( | $oldid = null , |
|
User | $user = null |
||
) |
#-
Lightweight method to get the parser output for a page, checking the parser cache and so on. Doesn't consider most of the stuff that Article::view() is forced to consider, so it's not appropriate to use there.
Definition at line 2306 of file Article.php.
References getParserOptions().
Article::getRedirectedFrom | ( | ) |
Get the page this view was redirected from.
Definition at line 201 of file Article.php.
References $mRedirectedFrom.
|
static |
Return the HTML for the top of a redirect page.
Chances are you should just be using the ParserOutput from WikitextContent::getParserOutput instead of calling this for redirects.
Language | $lang | |
Title | Title[] | $target | Destination(s) to redirect |
bool | $forceKnown | Should the image be shown as a bluelink regardless of existence? |
Definition at line 1769 of file Article.php.
References $lang, $linkRenderer, $title, MediaWiki\Linker\LinkRenderer\makeKnownLink(), MediaWiki\Linker\LinkRenderer\makeLink(), and wfMessage().
Referenced by WikitextContent\fillParserOutput().
Article::getRedirectTarget | ( | ) |
Definition at line 2650 of file Article.php.
References wfDeprecated().
Article::getRedirectURL | ( | $rt | ) |
Title | $rt |
Definition at line 2661 of file Article.php.
References wfDeprecated().
Article::getRevIdFetched | ( | ) |
Use this to fetch the rev ID used on page views.
Before fetchRevisionRecord was called, this returns the page's latest revision, regardless of what getOldID() returns.
Definition at line 482 of file Article.php.
Referenced by generateContentOutput(), and view().
Article::getRevision | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2672 of file Article.php.
References wfDeprecated().
Article::getRevisionFetched | ( | ) |
Get the fetched Revision object depending on request parameters or null on failure.
Refer to $this->fetchResult for the revision actually loaded from the database.
Definition at line 467 of file Article.php.
References fetchRevisionRecord(), and wfDeprecated().
|
private |
RevisionRecord | $revision |
Definition at line 870 of file Article.php.
References $content, and Revision\RevisionRecord\getContent().
Referenced by doOutputFromRenderStatus().
Article::getRobotPolicy | ( | $action, | |
ParserOutput | $pOutput = null |
||
) |
Get the robot policy to be used for the current view.
string | $action | The action= GET parameter |
ParserOutput | null | $pOutput |
Definition at line 960 of file Article.php.
References $wgArticleRobotPolicies, $wgDefaultRobotPolicy, $wgNamespaceRobotPolicies, formatRobotPolicy(), getContext(), getTitle(), NS_USER, and NS_USER_TALK.
Referenced by doOutputMetaData(), and showMissingArticle().
|
private |
Returns Content object to use when the page does not exist.
Definition at line 284 of file Article.php.
References $content, getContext(), getTitle(), ContentHandler\makeContent(), and NS_MEDIAWIKI.
Referenced by getContentObject().
Article::getTimestamp | ( | ) |
Definition at line 2682 of file Article.php.
References wfDeprecated().
Article::getTitle | ( | ) |
Get the title object of the article.
Definition at line 219 of file Article.php.
Referenced by ImageHistoryList\__construct(), EditPage\__construct(), ProtectionForm\__construct(), addHelpLink(), CategoryPage\closeShowCategory(), confirmDelete(), delete(), doDelete(), ImagePage\doRenderLangOpt(), fetchRevisionRecord(), generateContentOutput(), getOldIDFromRequest(), getRobotPolicy(), getSubstituteContent(), ImagePage\imageDupes(), ImagePage\imageLinks(), isFileCacheable(), ImagePage\loadFile(), ImagePage\openShowImage(), setOldSubtitle(), showDeletedRevisionHeader(), showMissingArticle(), showNamespaceHeader(), showPatrolFooter(), showRedirectedFromHeader(), showViewFooter(), tryFileCache(), ImagePage\uploadLinksBox(), view(), CategoryPage\view(), ImagePage\view(), and viewRedirect().
Article::getTouched | ( | ) |
Definition at line 2692 of file Article.php.
References wfDeprecated().
Referenced by CategoryPage\view().
Call to WikiPage function for backwards compatibility.
Definition at line 2705 of file Article.php.
References wfDeprecated().
Article::hasViewableContent | ( | ) |
Definition at line 2715 of file Article.php.
References wfDeprecated().
Article::insertOn | ( | $dbw, | |
$pageId = null |
|||
) |
IDatabase | $dbw | |
int | null | $pageId |
Definition at line 2727 of file Article.php.
References wfDeprecated().
Article::insertRedirect | ( | ) |
Definition at line 2737 of file Article.php.
References wfDeprecated().
Article::insertRedirectEntry | ( | Title | $rt, |
$oldLatest = null |
|||
) |
Title | $rt | |
int | null | $oldLatest |
Definition at line 2749 of file Article.php.
References wfDeprecated().
Article::isCountable | ( | $editInfo = false | ) |
PreparedEdit | bool | $editInfo |
Definition at line 2760 of file Article.php.
References wfDeprecated().
Article::isCurrent | ( | ) |
Returns true if the currently-referenced revision is the current edit to this page (and it exists).
Definition at line 447 of file Article.php.
References getOldID().
Referenced by view().
Article::isFileCacheable | ( | $mode = HTMLFileCache::MODE_NORMAL | ) |
Check if the page can be cached.
int | $mode | One of the HTMLFileCache::MODE_* constants (since 1.28) |
Definition at line 2278 of file Article.php.
References getContext(), getTitle(), and HTMLFileCache\useFileCache().
Referenced by tryFileCache().
Article::isRedirect | ( | ) |
Definition at line 2770 of file Article.php.
References wfDeprecated().
Referenced by showRedirectedFromHeader().
Article::loadFromRow | ( | $data, | |
$from | |||
) |
stdClass | bool | $data | |
string | int | $from |
Definition at line 2781 of file Article.php.
References wfDeprecated().
Article::loadPageData | ( | $from = 'fromdb' | ) |
stdClass | string | int | $from |
Definition at line 2791 of file Article.php.
References wfDeprecated().
Article::lockAndGetLatest | ( | ) |
Definition at line 2801 of file Article.php.
References wfDeprecated().
Article::makeParserOptions | ( | $context | ) |
IContextSource | User | string | $context |
Definition at line 2812 of file Article.php.
References wfDeprecated().
|
static |
Constructor from a page id.
int | $id | Article ID to load |
Definition at line 146 of file Article.php.
References $t, and Title\newFromID().
|
static |
Create an Article object of the appropriate class for the given page.
Title | $title | |
IContextSource | $context |
Definition at line 158 of file Article.php.
References $title, Title\makeTitle(), NS_CATEGORY, NS_FILE, NS_MEDIA, and Hooks\runner().
Referenced by MediaWiki\Permissions\PermissionManager\checkUserBlock(), ApiParse\execute(), RebuildFileCache\execute(), and newFromWikiPage().
|
static |
Create an Article object of the appropriate class for the given page.
WikiPage | $page | |
IContextSource | $context |
Definition at line 190 of file Article.php.
References WikiPage\getTitle(), and newFromTitle().
Referenced by Action\convertPageToArticle(), ApiEditPage\execute(), Action\getActionName(), Skin\getFooterLinks(), and MediaWiki\initializeArticle().
|
protected |
Title | $title |
Reimplemented in ImagePage, and CategoryPage.
Definition at line 137 of file Article.php.
References $title.
Referenced by __construct().
Article::pageDataFromId | ( | $dbr, | |
$id, | |||
$options = [] |
|||
) |
IDatabase | $dbr | |
int | $id | |
array | $options |
Definition at line 2825 of file Article.php.
References $dbr, and wfDeprecated().
Article::pageDataFromTitle | ( | $dbr, | |
$title, | |||
$options = [] |
|||
) |
IDatabase | $dbr | |
Title | $title | |
array | $options |
Definition at line 2838 of file Article.php.
References $dbr, $title, and wfDeprecated().
Article::prepareContentForEdit | ( | Content | $content, |
$revision = null , |
|||
User | $user = null , |
||
$serialFormat = null , |
|||
$useCache = true |
|||
) |
Call to WikiPage function for backwards compatibility.
Content | $content | |
Revision | RevisionRecord | null | $revision | |
User | null | $user | |
string | null | $serialFormat | |
bool | $useCache |
Definition at line 2856 of file Article.php.
References $content, and wfDeprecated().
Article::protect | ( | ) |
Article::protectDescription | ( | array | $limit, |
array | $expiry | ||
) |
array | $limit | |
array | $expiry |
Definition at line 2874 of file Article.php.
References wfDeprecated().
Article::protectDescriptionLog | ( | array | $limit, |
array | $expiry | ||
) |
array | $limit | |
array | $expiry |
Definition at line 2886 of file Article.php.
References wfDeprecated().
|
static |
Purge the cache used to check if it is worth showing the patrol footer For example, it is done during re-uploads when file patrol is used.
int | $articleID | ID of the article to purge |
Definition at line 1348 of file Article.php.
References $cache.
Referenced by LocalFile\recordUpload3().
Article::render | ( | ) |
Handle action=render.
Definition at line 1833 of file Article.php.
References getContext(), and view().
Article::replaceSectionAtRev | ( | $sectionId, | |
Content | $sectionContent, | ||
$sectionTitle = '' , |
|||
$baseRevId = null |
|||
) |
string | int | null | bool | $sectionId | |
Content | $sectionContent | |
string | $sectionTitle | |
int | null | $baseRevId |
Definition at line 2900 of file Article.php.
References wfDeprecated().
Article::replaceSectionContent | ( | $sectionId, | |
Content | $sectionContent, | ||
$sectionTitle = '' , |
|||
$edittime = null |
|||
) |
Call to WikiPage function for backwards compatibility.
string | int | null | bool | $sectionId | |
Content | $sectionContent | |
string | $sectionTitle | |
string | null | $edittime |
Definition at line 2920 of file Article.php.
References wfDeprecated().
Article::setContext | ( | $context | ) |
Sets the context this Article is executed in.
IContextSource | $context |
Definition at line 2330 of file Article.php.
Article::setOldSubtitle | ( | $oldid = 0 | ) |
Generate the navigation links when browsing through an article revisions It shows the information as: Revision as of \<date\>; view current revision \<- Previous version | Next Version -\>
int | $oldid | Revision ID of this article revision |
Definition at line 1596 of file Article.php.
References $mRevisionRecord, getContext(), Linker\getRevDeleteLink(), Revision\RevisionRecord\getTimestamp(), getTitle(), Linker\revComment(), and Linker\revUserTools().
Referenced by generateContentOutput().
Article::setRedirectedFrom | ( | Title | $from | ) |
Tell the page view functions that this view was redirected from another page on the wiki.
Title | $from |
Definition at line 210 of file Article.php.
Article::setTimestamp | ( | $ts | ) |
string | $ts |
Definition at line 2934 of file Article.php.
References wfDeprecated().
Article::shouldCheckParserCache | ( | ParserOptions | $parserOptions, |
$oldId | |||
) |
ParserOptions | $parserOptions | |
int | $oldId |
Definition at line 2946 of file Article.php.
References wfDeprecated().
Article::showDeletedRevisionHeader | ( | ) |
If the revision requested for view is deleted, check permissions.
Send either an error message or a warning header to the output.
Definition at line 1534 of file Article.php.
References getContext(), getOldID(), getTitle(), and Html\warningBox().
Referenced by generateContentOutput().
|
protected |
Show a diff page according to current request variables.
For use within Article::view() only, other callers should use the DifferenceEngine class.
Definition at line 897 of file Article.php.
References fetchRevisionRecord(), getContext(), getOldID(), and wfMessage().
Referenced by view().
Article::showMissingArticle | ( | ) |
Show the error text for a missing article.
For articles in the MediaWiki namespace, show the default message text. To be called from Article::view().
Definition at line 1357 of file Article.php.
References $dbr, $lang, $permManager, $title, $wgSend404Code, DB_REPLICA, getContext(), ObjectCache\getInstance(), getOldID(), getRobotPolicy(), getTitle(), User\isIP(), User\newFromName(), NS_MEDIAWIKI, NS_USER, NS_USER_TALK, Xml\openElement(), LogEventsList\showLogExtract(), wfEscapeWikiText(), wfGetDB(), and wfMessage().
Referenced by generateContentOutput().
Article::showNamespaceHeader | ( | ) |
Show a header specific to the namespace currently being viewed, like [[MediaWiki:Talkpagetext]].
For Article::view().
Definition at line 1143 of file Article.php.
References getContext(), getTitle(), and wfMessage().
Referenced by view().
Article::showPatrolFooter | ( | ) |
If patrol is possible, output a patrol UI box.
This is called from the footer section of ordinary page views. If patrol is not possible or not desired, does nothing.
Side effect: When the patrol link is build, this method will call OutputPage::preventClickjacking() and load a JS module.
Definition at line 1179 of file Article.php.
References $cache, $dbr, $title, $wgUseFilePatrol, $wgUseNPPatrol, $wgUseRCPatrol, DB_REPLICA, getContext(), getTitle(), RecentChange\isInRCLifespan(), RecentChange\newFromConds(), NS_FILE, RC_LOG, wfGetDB(), and wfMessage().
Referenced by showViewFooter().
Article::showRedirectedFromHeader | ( | ) |
If this request is a redirect view, send "redirected from" subtitle to the output.
Returns true if the header was needed, false if this is not a redirect view. Handles both local and remote redirects.
Definition at line 1069 of file Article.php.
References $wgRedirectSources, getContext(), getTitle(), isRedirect(), and Linker\makeExternalLink().
Referenced by view().
|
private |
Show error text for errors generated in Article::view().
string | $errortext | localized wikitext error message |
Definition at line 1519 of file Article.php.
References getContext().
Referenced by doOutputFromRenderStatus(), and generateContentOutput().
Article::showViewFooter | ( | ) |
Show the footer section of an ordinary page view.
Definition at line 1155 of file Article.php.
References getContext(), getTitle(), NS_USER_TALK, and showPatrolFooter().
Referenced by view().
Article::supportsSections | ( | ) |
Definition at line 2956 of file Article.php.
References wfDeprecated().
Article::triggerOpportunisticLinksUpdate | ( | ParserOutput | $parserOutput | ) |
ParserOutput | $parserOutput |
Definition at line 2966 of file Article.php.
References wfDeprecated().
|
protected |
checkLastModified returns true if it has taken care of all output to the client that is necessary for this request.
(that is, it has sent a cached version of the page)
Definition at line 2247 of file Article.php.
References $cache, getContext(), getTitle(), isFileCacheable(), and wfDebug().
Referenced by view().
Article::unprotect | ( | ) |
Article::updateCategoryCounts | ( | array | $added, |
array | $deleted, | ||
$id = 0 |
|||
) |
array | $added | |
array | $deleted | |
int | $id |
Definition at line 2978 of file Article.php.
References wfDeprecated().
Article::updateIfNewerOn | ( | $dbw, | |
$revision | |||
) |
Call to WikiPage function for backwards compatibility.
IDatabase | $dbw | |
Revision | $revision |
Definition at line 2991 of file Article.php.
References wfDeprecated().
Article::updateRedirectOn | ( | $dbw, | |
$redirectTitle, | |||
$lastRevIsRedirect = null |
|||
) |
IDatabase | $dbw | |
Title | null | $redirectTitle | |
null | bool | $lastRevIsRedirect |
Definition at line 3004 of file Article.php.
References wfDeprecated().
Article::updateRestrictions | ( | $limit = [] , |
|
$reason = '' , |
|||
& | $cascade = 0 , |
||
$expiry = [] |
|||
) |
array | $limit | |
string | $reason | |
int | &$cascade | |
array | $expiry |
Definition at line 3051 of file Article.php.
References getContext(), getUser(), and wfDeprecated().
Article::updateRevisionOn | ( | $dbw, | |
$revision, | |||
$lastRevision = null , |
|||
$lastRevIsRedirect = null |
|||
) |
IDatabase | $dbw | |
Revision | $revision | |
int | null | $lastRevision | |
bool | null | $lastRevIsRedirect |
Definition at line 3018 of file Article.php.
References wfDeprecated().
Article::view | ( | ) |
This is the default action of the index.php entry point: just view the page of the given title.
Reimplemented in ImagePage, and CategoryPage.
Definition at line 494 of file Article.php.
References $wgUseFileCache, generateContentOutput(), getContext(), getOldID(), getParserOptions(), getRevIdFetched(), getTitle(), isCurrent(), EditPage\POST_EDIT_COOKIE_KEY_PREFIX, Hooks\runner(), showDiffPage(), showNamespaceHeader(), showRedirectedFromHeader(), showViewFooter(), tryFileCache(), Html\warningBox(), wfDebug(), and wfMessage().
Referenced by render().
Article::viewRedirect | ( | $target, | |
$appendSubtitle = true , |
|||
$forceKnown = false |
|||
) |
Return the HTML for the top of a redirect page.
Chances are you should just be using the ParserOutput from WikitextContent::getParserOutput instead of calling this for redirects.
Title | array | $target | Destination(s) to redirect |
bool | $appendSubtitle | [optional] |
bool | $forceKnown | Should the image be shown as a bluelink regardless of existence? |
Definition at line 1747 of file Article.php.
References $lang, getContext(), getTitle(), and wfMessage().
|
private |
represents the outcome of fetchRevisionRecord().
$fetchResult->value is the RevisionRecord object, if the operation was successful.
Definition at line 77 of file Article.php.
|
protected |
Definition at line 96 of file Article.php.
Referenced by getRedirectHeaderHtml(), ImagePage\imageDupes(), ImagePage\imageLinks(), and ImagePage\openShowImage().
|
protected |
The context this Article is executed in.
If null, RequestContext::getMain() is used.
Definition at line 56 of file Article.php.
Referenced by getContext().
int null Article::$mOldId |
The oldid of the article that was requested to be shown, 0 for the current revision.
Definition at line 65 of file Article.php.
Referenced by getOldID().
|
protected |
The WikiPage object of this instance.
Definition at line 59 of file Article.php.
Referenced by getPage().
ParserOutput null false Article::$mParserOutput = null |
The ParserOutput generated for viewing the page, initialized by view().
If no ParserOutput could be generated, this is set to false.
Definition at line 84 of file Article.php.
Title null Article::$mRedirectedFrom = null |
Title from which we were redirected here, if any.
Definition at line 68 of file Article.php.
Referenced by getRedirectedFrom().
string bool Article::$mRedirectUrl = false |
URL to redirect to or false if none.
Definition at line 71 of file Article.php.
|
private |
Revision to be shown.
Initialized by getOldIDFromRequest() or fetchRevisionRecord(). While the output of Article::view is typically based on this revision, it may be replaced by extensions.
Replaced $mRevision, which was public and is provided in a deprecated manner via __get and __set
Definition at line 117 of file Article.php.
Referenced by fetchRevisionRecord(), getOldIDFromRequest(), and setOldSubtitle().
|
private |
Definition at line 101 of file Article.php.
Referenced by showMissingArticle().
|
private |
Definition at line 106 of file Article.php.
|
protected |
Whether render() was called.
With the way subclasses work here, there doesn't seem to be any other way to stop calling OutputPage::enableSectionEditLinks() and still have it work as it did before.
Definition at line 91 of file Article.php.