MediaWiki REL1_34
|
Class for viewing MediaWiki article and history. More...
Public Member Functions | |
__construct (Title $title, $oldId=null) | |
Constructor and clear the article. | |
__get ( $fname) | |
Use PHP's magic __get handler to handle accessing of raw WikiPage fields for backwards compatibility. | |
__set ( $fname, $fvalue) | |
Use PHP's magic __set handler to handle setting of raw WikiPage fields for backwards compatibility. | |
addHelpLink ( $to, $overrideBaseUrl=false) | |
Adds help link with an icon via page indicators. | |
adjustDisplayTitle (ParserOutput $pOutput) | |
Adjust title for pages with displaytitle, -{T|}- or language conversion. | |
checkFlags ( $flags) | |
Call to WikiPage function for backwards compatibility. | |
checkTouched () | |
Call to WikiPage function for backwards compatibility. | |
clear () | |
Clear the object. | |
clearPreparedEdit () | |
Call to WikiPage function for backwards compatibility. | |
commitRollback ( $fromP, $summary, $bot, &$resultDetails, User $guser=null) | |
confirmDelete ( $reason) | |
Output deletion confirmation dialog. | |
delete () | |
UI entry point for page deletion. | |
doDelete ( $reason, $suppress=false, $immediate=false) | |
Perform a deletion and output success or failure messages. | |
doDeleteArticle ( $reason, $suppress=false, $u1=null, $u2=null, &$error='', $immediate=false) | |
doDeleteArticleReal ( $reason, $suppress=false, $u1=null, $u2=null, &$error='', User $user=null, $tags=[], $immediate=false) | |
Call to WikiPage function for backwards compatibility. | |
doDeleteUpdates ( $id, Content $content=null, $revision=null, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
doEditContent (Content $content, $summary, $flags=0, $originalRevId=false, User $user=null, $serialFormat=null) | |
Call to WikiPage function for backwards compatibility. | |
doEditUpdates (Revision $revision, User $user, array $options=[]) | |
Call to WikiPage function for backwards compatibility. | |
doPurge () | |
Call to WikiPage function for backwards compatibility. | |
doRollback ( $fromP, $summary, $token, $bot, &$resultDetails, User $user=null) | |
doUpdateRestrictions (array $limit, array $expiry, &$cascade, $reason, User $user) | |
doViewUpdates (User $user, $oldid=0) | |
Call to WikiPage function for backwards compatibility. | |
exists () | |
Call to WikiPage function for backwards compatibility. | |
followRedirect () | |
Call to WikiPage function for backwards compatibility. | |
generateReason (&$hasHistory) | |
getActionOverrides () | |
Call to WikiPage function for backwards compatibility. | |
getAutoDeleteReason (&$hasHistory) | |
Call to WikiPage function for backwards compatibility. | |
getCategories () | |
Call to WikiPage function for backwards compatibility. | |
getComment ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
getContentHandler () | |
Call to WikiPage function for backwards compatibility. | |
getContentModel () | |
Call to WikiPage function for backwards compatibility. | |
getContext () | |
Gets the context this Article is executed in. | |
getContributors () | |
Call to WikiPage function for backwards compatibility. | |
getCreator ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
getDeletionUpdates (Content $content=null) | |
Call to WikiPage function for backwards compatibility. | |
getHiddenCategories () | |
Call to WikiPage function for backwards compatibility. | |
getId () | |
Call to WikiPage function for backwards compatibility. | |
getLatest () | |
Call to WikiPage function for backwards compatibility. | |
getLinksTimestamp () | |
Call to WikiPage function for backwards compatibility. | |
getMinorEdit () | |
Call to WikiPage function for backwards compatibility. | |
getOldestRevision () | |
Call to WikiPage function for backwards compatibility. | |
getOldID () | |
getOldIDFromRequest () | |
Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect. | |
getPage () | |
Get the WikiPage object of this instance. | |
getParserOptions () | |
Get parser options suitable for rendering the primary article wikitext. | |
getParserOutput ( $oldid=null, User $user=null) | |
#- | |
getRedirectedFrom () | |
Get the page this view was redirected from. | |
getRedirectTarget () | |
Call to WikiPage function for backwards compatibility. | |
getRedirectURL ( $rt) | |
Call to WikiPage function for backwards compatibility. | |
getRevIdFetched () | |
Use this to fetch the rev ID used on page views. | |
getRevision () | |
Call to WikiPage function for backwards compatibility. | |
getRevisionFetched () | |
Get the fetched Revision object depending on request parameters or null on failure. | |
getRobotPolicy ( $action, ParserOutput $pOutput=null) | |
Get the robot policy to be used for the current view. | |
getTimestamp () | |
Call to WikiPage function for backwards compatibility. | |
getTitle () | |
Get the title object of the article. | |
getTouched () | |
Call to WikiPage function for backwards compatibility. | |
getUndoContent (Revision $undo, Revision $undoafter=null) | |
Call to WikiPage function for backwards compatibility. | |
getUser ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
getUserText ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
hasViewableContent () | |
Call to WikiPage function for backwards compatibility. | |
insertOn ( $dbw, $pageId=null) | |
Call to WikiPage function for backwards compatibility. | |
insertProtectNullRevision ( $revCommentMsg, array $limit, array $expiry, $cascade, $reason, $user=null) | |
Call to WikiPage function for backwards compatibility. | |
insertRedirect () | |
Call to WikiPage function for backwards compatibility. | |
insertRedirectEntry (Title $rt, $oldLatest=null) | |
Call to WikiPage function for backwards compatibility. | |
isCountable ( $editInfo=false) | |
Call to WikiPage function for backwards compatibility. | |
isCurrent () | |
Returns true if the currently-referenced revision is the current edit to this page (and it exists). | |
isFileCacheable ( $mode=HTMLFileCache::MODE_NORMAL) | |
Check if the page can be cached. | |
isRedirect () | |
Call to WikiPage function for backwards compatibility. | |
loadFromRow ( $data, $from) | |
Call to WikiPage function for backwards compatibility. | |
loadPageData ( $from='fromdb') | |
Call to WikiPage function for backwards compatibility. | |
lockAndGetLatest () | |
Call to WikiPage function for backwards compatibility. | |
makeParserOptions ( $context) | |
Call to WikiPage function for backwards compatibility. | |
pageDataFromId ( $dbr, $id, $options=[]) | |
Call to WikiPage function for backwards compatibility. | |
pageDataFromTitle ( $dbr, $title, $options=[]) | |
Call to WikiPage function for backwards compatibility. | |
prepareContentForEdit (Content $content, $revision=null, User $user=null, $serialFormat=null, $useCache=true) | |
Call to WikiPage function for backwards compatibility. | |
protect () | |
action=protect handler | |
protectDescription (array $limit, array $expiry) | |
Call to WikiPage function for backwards compatibility. | |
protectDescriptionLog (array $limit, array $expiry) | |
Call to WikiPage function for backwards compatibility. | |
render () | |
Handle action=render. | |
replaceSectionAtRev ( $sectionId, Content $sectionContent, $sectionTitle='', $baseRevId=null) | |
Call to WikiPage function for backwards compatibility. | |
replaceSectionContent ( $sectionId, Content $sectionContent, $sectionTitle='', $edittime=null) | |
Call to WikiPage function for backwards compatibility. | |
setContext ( $context) | |
Sets the context this Article is executed in. | |
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 -\> | |
setParserOptions (ParserOptions $options) | |
Override the ParserOptions used to render the primary article wikitext. | |
setRedirectedFrom (Title $from) | |
Tell the page view functions that this view was redirected from another page on the wiki. | |
setTimestamp ( $ts) | |
Call to WikiPage function for backwards compatibility. | |
shouldCheckParserCache (ParserOptions $parserOptions, $oldId) | |
Call to WikiPage function for backwards compatibility. | |
showDeletedRevisionHeader () | |
If the revision requested for view is deleted, check permissions. | |
showMissingArticle () | |
Show the error text for a missing article. | |
showNamespaceHeader () | |
Show a header specific to the namespace currently being viewed, like [[MediaWiki:Talkpagetext]]. | |
showPatrolFooter () | |
If patrol is possible, output a patrol UI box. | |
showRedirectedFromHeader () | |
If this request is a redirect view, send "redirected from" subtitle to the output. | |
showViewFooter () | |
Show the footer section of an ordinary page view. | |
supportsSections () | |
Call to WikiPage function for backwards compatibility. | |
triggerOpportunisticLinksUpdate (ParserOutput $parserOutput) | |
Call to WikiPage function for backwards compatibility. | |
unprotect () | |
action=unprotect handler (alias) | |
updateCategoryCounts (array $added, array $deleted, $id=0) | |
Call to WikiPage function for backwards compatibility. | |
updateIfNewerOn ( $dbw, $revision) | |
Call to WikiPage function for backwards compatibility. | |
updateRedirectOn ( $dbw, $redirectTitle, $lastRevIsRedirect=null) | |
Call to WikiPage function for backwards compatibility. | |
updateRestrictions ( $limit=[], $reason='', &$cascade=0, $expiry=[]) | |
updateRevisionOn ( $dbw, $revision, $lastRevision=null, $lastRevIsRedirect=null) | |
Call to WikiPage function for backwards compatibility. | |
view () | |
This is the default action of the index.php entry point: just view the page of the given title. | |
viewRedirect ( $target, $appendSubtitle=true, $forceKnown=false) | |
Return the HTML for the top of a redirect page. | |
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(). | |
static | getRedirectHeaderHtml (Language $lang, $target, $forceKnown=false) |
Return the HTML for the top of a redirect page. | |
static | newFromID ( $id) |
Constructor from a page id. | |
static | newFromTitle ( $title, IContextSource $context) |
Create an Article object of the appropriate class for the given page. | |
static | newFromWikiPage (WikiPage $page, IContextSource $context) |
Create an Article object of the appropriate class for the given page. | |
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. | |
Public Attributes | |
bool | $mContentLoaded = false |
Is the target revision loaded? Set by fetchRevisionRecord(). | |
Content null | $mContentObject |
Content of the main slot of $this->mRevision. | |
int null | $mOldId |
The oldid of the article that was requested to be shown, 0 for the current revision. | |
ParserOptions null | $mParserOptions |
ParserOptions object for $wgUser articles. | |
ParserOutput null false | $mParserOutput = null |
The ParserOutput generated for viewing the page, initialized by view(). | |
Title null | $mRedirectedFrom = null |
Title from which we were redirected here, if any. | |
string bool | $mRedirectUrl = false |
URL to redirect to or false if none. | |
int | $mRevIdFetched = 0 |
Revision ID of revision that was loaded. | |
Revision null | $mRevision = null |
Revision to be shown. | |
Protected Member Functions | |
fetchContentObject () | |
Get text content object Does NOT follow redirects. | |
fetchRevisionRecord () | |
Fetches the revision to work on. | |
getContentObject () | |
Returns a Content object representing the pages effective display content, not necessarily the revision's content! | |
getEmptyPageParserOutput (ParserOptions $options) | |
Returns ParserOutput to use when a page does not exist. | |
newPage (Title $title) | |
showDiffPage () | |
Show a diff page according to current request variables. | |
tryFileCache () | |
checkLastModified returns true if it has taken care of all output to the client that is necessary for this request. | |
Protected Attributes | |
IContextSource null | $mContext |
The context this Article is executed in. | |
WikiPage null | $mPage |
The WikiPage object of this instance. | |
bool | $viewIsRenderAction = false |
Whether render() was called. | |
Private Member Functions | |
applyContentOverride (Content $override) | |
Applies a content override by constructing a fake Revision object and assigning it to mRevision. | |
getRevisionRedirectTarget (RevisionRecord $revision) | |
getSubstituteContent () | |
Returns Content object to use when the page does not exist. | |
makeFetchErrorContent () | |
Returns a Content object representing any error in $this->fetchContent, or null if there is no such error. | |
Private Attributes | |
Status null | $fetchResult = null |
represents the outcome of fetchRevisionRecord(). | |
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 38 of file Article.php.
Article::__construct | ( | Title | $title, |
$oldId = null ) |
Article::__get | ( | $fname | ) |
Use PHP's magic __get handler to handle accessing of raw WikiPage fields for backwards compatibility.
string | $fname | Field name |
Definition at line 2284 of file Article.php.
Article::__set | ( | $fname, | |
$fvalue ) |
Use PHP's magic __set handler to handle setting of raw WikiPage fields for backwards compatibility.
string | $fname | Field name |
mixed | $fvalue | New value |
Definition at line 2299 of file Article.php.
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 1748 of file Article.php.
References getContext(), getTitle(), and wfMessage().
Referenced by CategoryPage\closeShowCategory().
Article::adjustDisplayTitle | ( | ParserOutput | $pOutput | ) |
Adjust title for pages with displaytitle, -{T|}- or language conversion.
ParserOutput | $pOutput |
Definition at line 902 of file Article.php.
References getContext(), and ParserOutput\getTitleText().
Referenced by view().
|
private |
Applies a content override by constructing a fake Revision object and assigning it to mRevision.
The fake revision will not have a user, timestamp or summary set.
This mechanism exists mainly to accommodate extensions that use the ArticleAfterFetchContentObject. Once that hook has been removed, there should no longer be a need for a fake revision object. fetchRevisionRecord() presently also uses this mechanism to report errors, but that could be changed to use $this->fetchResult instead.
Content | $override | Content to be used instead of the actual page content, coming from an extension or representing an error message. |
Definition at line 541 of file Article.php.
References getTitle().
Referenced by fetchRevisionRecord().
Article::checkFlags | ( | $flags | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2315 of file Article.php.
Article::checkTouched | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2323 of file Article.php.
Article::clear | ( | ) |
Clear the object.
Definition at line 238 of file Article.php.
Article::clearPreparedEdit | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2331 of file Article.php.
Article::commitRollback | ( | $fromP, | |
$summary, | |||
$bot, | |||
& | $resultDetails, | ||
User | $guser = null ) |
string | $fromP | |
string | $summary | |
bool | $bot | |
array | &$resultDetails | |
User | null | $guser |
Definition at line 2907 of file Article.php.
References getContext().
Article::confirmDelete | ( | $reason | ) |
Output deletion confirmation dialog.
string | $reason | Prefilled reason |
Definition at line 1922 of file Article.php.
References $title, getContext(), getTitle(), Linker\linkKnown(), Message\numParam(), LogEventsList\showLogExtract(), wfDebug(), and wfMessage().
Referenced by delete().
Article::delete | ( | ) |
UI entry point for page deletion.
Reimplemented in ImagePage.
Definition at line 1791 of file Article.php.
References $context, $dbr, $title, $wgDeleteRevisionsLimit, confirmDelete(), DB_REPLICA, doDelete(), WatchAction\doWatchOrUnwatch(), generateReason(), getContext(), getTitle(), Linker\linkKnown(), 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 2094 of file Article.php.
References $context, getContext(), getTitle(), LogEventsList\showLogExtract(), wfEscapeWikiText(), and wfMessage().
Referenced by delete().
Article::doDeleteArticle | ( | $reason, | |
$suppress = false, | |||
$u1 = null, | |||
$u2 = null, | |||
& | $error = '', | ||
$immediate = false ) |
string | $reason | |
bool | $suppress | |
int | null | $u1 | Unused |
bool | null | $u2 | Unused |
string | &$error | |
bool | $immediate | false allows deleting over time via the job queue |
FatalError | |
MWException |
Definition at line 2875 of file Article.php.
Article::doDeleteArticleReal | ( | $reason, | |
$suppress = false, | |||
$u1 = null, | |||
$u2 = null, | |||
& | $error = '', | ||
User | $user = null, | ||
$tags = [], | |||
$immediate = false ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2339 of file Article.php.
Call to WikiPage function for backwards compatibility.
Definition at line 2352 of file Article.php.
References $content.
Article::doEditContent | ( | Content | $content, |
$summary, | |||
$flags = 0, | |||
$originalRevId = false, | |||
User | $user = null, | ||
$serialFormat = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2366 of file Article.php.
References $content, and wfDeprecated().
Call to WikiPage function for backwards compatibility.
Definition at line 2379 of file Article.php.
Article::doPurge | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2389 of file Article.php.
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 2891 of file Article.php.
References getContext().
Article::doUpdateRestrictions | ( | array | $limit, |
array | $expiry, | ||
& | $cascade, | ||
$reason, | |||
User | $user ) |
array | $limit | |
array | $expiry | |
bool | &$cascade | |
string | $reason | |
User | $user |
Definition at line 2839 of file Article.php.
Article::doViewUpdates | ( | User | $user, |
$oldid = 0 ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2397 of file Article.php.
Article::exists | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2405 of file Article.php.
|
protected |
Get text content object Does NOT follow redirects.
Definition at line 414 of file Article.php.
References $mContentObject, and fetchRevisionRecord().
Referenced by getContentObject(), and view().
|
protected |
Fetches the revision to work on.
The revision is typically loaded from the database, but may also be a fake representing an error message or content supplied by an extension. Refer to $this->fetchResult for the revision actually loaded from the database, and any errors encountered while doing that.
Definition at line 431 of file Article.php.
References applyContentOverride(), getContext(), getOldID(), getTitle(), getUser(), makeFetchErrorContent(), and wfDebug().
Referenced by fetchContentObject(), getRevisionFetched(), and view().
Article::followRedirect | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2413 of file Article.php.
|
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 1047 of file Article.php.
Referenced by getRobotPolicy(), and OutputPage\setRobotPolicy().
Article::generateReason | ( | & | $hasHistory | ) |
bool | &$hasHistory |
Definition at line 2919 of file Article.php.
References $title.
Referenced by delete().
Article::getActionOverrides | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2421 of file Article.php.
Article::getAutoDeleteReason | ( | & | $hasHistory | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2429 of file Article.php.
Article::getCategories | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2437 of file Article.php.
Article::getComment | ( | $audience = RevisionRecord::FOR_PUBLIC, | |
User | $user = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2445 of file Article.php.
Article::getContentHandler | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2453 of file Article.php.
Article::getContentModel | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2461 of file Article.php.
|
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 270 of file Article.php.
References $content, $mContentObject, fetchContentObject(), and getSubstituteContent().
Article::getContext | ( | ) |
Gets the context this Article is executed in.
Definition at line 2267 of file Article.php.
References $mContext, and wfDebug().
Referenced by ImageHistoryList\__construct(), EditPage\__construct(), ProtectionForm\__construct(), addHelpLink(), adjustDisplayTitle(), CategoryPage\closeShowCategory(), commitRollback(), confirmDelete(), ImagePage\createXmlOptionStringForLanguage(), delete(), doDelete(), ImagePage\doRenderLangOpt(), doRollback(), fetchRevisionRecord(), getOldIDFromRequest(), getParserOptions(), getRobotPolicy(), getSubstituteContent(), ImagePage\getThumbPrevText(), ImagePage\getThumbSizes(), ImagePage\imageDupes(), ImagePage\imageHistory(), ImagePage\imageLinks(), isFileCacheable(), ImagePage\makeMetadataTable(), MultimediaViewerHooks\onCategoryPageView(), RenameuserHooks\onShowMissingArticle(), ImagePage\openShowImage(), ImagePage\printSharedImageText(), render(), setOldSubtitle(), showDeletedRevisionHeader(), showDiffPage(), ScribuntoHooks\showDocPageHeader(), ImagePage\showError(), showMissingArticle(), showNamespaceHeader(), showPatrolFooter(), showRedirectedFromHeader(), ImagePage\showTOC(), showViewFooter(), tryFileCache(), updateRestrictions(), ImagePage\uploadLinksBox(), view(), CategoryPage\view(), ImagePage\view(), and viewRedirect().
Article::getContributors | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2469 of file Article.php.
Article::getCreator | ( | $audience = RevisionRecord::FOR_PUBLIC, | |
User | $user = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2477 of file Article.php.
Article::getDeletionUpdates | ( | Content | $content = null | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2485 of file Article.php.
References $content.
|
protected |
Returns ParserOutput to use when a page does not exist.
In some cases, we still want to show "virtual" content, e.g. in the MediaWiki namespace, or in the File namespace for non-local files.
ParserOptions | $options |
Reimplemented in ImagePage.
Definition at line 313 of file Article.php.
References $content, getSubstituteContent(), and getTitle().
Referenced by showMissingArticle().
Article::getHiddenCategories | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2493 of file Article.php.
Article::getId | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2501 of file Article.php.
Referenced by ImagePage\openShowImage().
Article::getLatest | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2509 of file Article.php.
Article::getLinksTimestamp | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2517 of file Article.php.
Article::getMinorEdit | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2525 of file Article.php.
Article::getOldestRevision | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2533 of file Article.php.
Article::getOldID | ( | ) |
Definition at line 326 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 339 of file Article.php.
References getContext(), and getTitle().
Referenced by getOldID().
Article::getPage | ( | ) |
Get the WikiPage object of this instance.
Definition at line 231 of file Article.php.
References $mPage.
Referenced by ImageHistoryList\__construct(), EditPage\__construct(), and view().
Article::getParserOptions | ( | ) |
Get parser options suitable for rendering the primary article wikitext.
Definition at line 2243 of file Article.php.
References $mParserOptions, and 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 2212 of file Article.php.
References getParserOptions().
Article::getRedirectedFrom | ( | ) |
Get the page this view was redirected from.
Definition at line 203 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 | array | $target | Destination(s) to redirect |
bool | $forceKnown | Should the image be shown as a bluelink regardless of existence? |
Definition at line 1713 of file Article.php.
References $lang, $title, Linker\link(), and wfMessage().
Referenced by WikitextContent\fillParserOutput().
Article::getRedirectTarget | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2541 of file Article.php.
Article::getRedirectURL | ( | $rt | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2549 of file Article.php.
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 591 of file Article.php.
Referenced by view().
Article::getRevision | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2557 of file Article.php.
Article::getRevisionFetched | ( | ) |
Get the fetched Revision object depending on request parameters or null on failure.
The revision returned may be a fake representing an error message or wrapping content supplied by an extension. Refer to $this->fetchResult for the revision actually loaded from the database.
Definition at line 575 of file Article.php.
References $mRevision, and fetchRevisionRecord().
Referenced by showDiffPage().
|
private |
RevisionRecord | $revision |
Definition at line 890 of file Article.php.
References $content, and MediaWiki\Revision\RevisionRecord\getContent().
Referenced by view().
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 967 of file Article.php.
References $wgArticleRobotPolicies, $wgDefaultRobotPolicy, $wgNamespaceRobotPolicies, formatRobotPolicy(), getContext(), getTitle(), NS_USER, and NS_USER_TALK.
Referenced by showMissingArticle(), and view().
|
private |
Returns Content object to use when the page does not exist.
Definition at line 286 of file Article.php.
References $content, getContext(), getTitle(), and NS_MEDIAWIKI.
Referenced by getContentObject(), and getEmptyPageParserOutput().
Article::getTimestamp | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2565 of file Article.php.
Article::getTitle | ( | ) |
Get the title object of the article.
Definition at line 221 of file Article.php.
Referenced by ImageHistoryList\__construct(), EditPage\__construct(), ProtectionForm\__construct(), addHelpLink(), applyContentOverride(), CategoryPage\closeShowCategory(), confirmDelete(), delete(), doDelete(), ImagePage\doRenderLangOpt(), fetchRevisionRecord(), getEmptyPageParserOutput(), getOldIDFromRequest(), getRobotPolicy(), getSubstituteContent(), ImagePage\imageDupes(), ImagePage\imageLinks(), isFileCacheable(), ImagePage\loadFile(), MultimediaViewerHooks\onCategoryPageView(), RenameuserHooks\onShowMissingArticle(), ImagePage\openShowImage(), setOldSubtitle(), showDeletedRevisionHeader(), ScribuntoHooks\showDocPageHeader(), showMissingArticle(), showNamespaceHeader(), showPatrolFooter(), showRedirectedFromHeader(), showViewFooter(), tryFileCache(), ImagePage\uploadLinksBox(), view(), CategoryPage\view(), ImagePage\view(), and viewRedirect().
Article::getTouched | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2573 of file Article.php.
Call to WikiPage function for backwards compatibility.
Definition at line 2581 of file Article.php.
Article::getUser | ( | $audience = RevisionRecord::FOR_PUBLIC, | |
User | $user = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2589 of file Article.php.
Article::getUserText | ( | $audience = RevisionRecord::FOR_PUBLIC, | |
User | $user = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2597 of file Article.php.
Article::hasViewableContent | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2605 of file Article.php.
Article::insertOn | ( | $dbw, | |
$pageId = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2613 of file Article.php.
Article::insertProtectNullRevision | ( | $revCommentMsg, | |
array | $limit, | ||
array | $expiry, | ||
$cascade, | |||
$reason, | |||
$user = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2621 of file Article.php.
Article::insertRedirect | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2633 of file Article.php.
Article::insertRedirectEntry | ( | Title | $rt, |
$oldLatest = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2641 of file Article.php.
Article::isCountable | ( | $editInfo = false | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2649 of file Article.php.
Article::isCurrent | ( | ) |
Returns true if the currently-referenced revision is the current edit to this page (and it exists).
Definition at line 557 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 2182 of file Article.php.
References getContext(), getTitle(), and HTMLFileCache\useFileCache().
Referenced by tryFileCache().
Article::isRedirect | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2657 of file Article.php.
Referenced by showRedirectedFromHeader().
Article::loadFromRow | ( | $data, | |
$from ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2665 of file Article.php.
Article::loadPageData | ( | $from = 'fromdb' | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2673 of file Article.php.
Article::lockAndGetLatest | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2681 of file Article.php.
|
private |
Returns a Content object representing any error in $this->fetchContent, or null if there is no such error.
Definition at line 521 of file Article.php.
Referenced by fetchRevisionRecord().
Article::makeParserOptions | ( | $context | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2689 of file Article.php.
References $context.
|
static |
Constructor from a page id.
int | $id | Article ID to load |
Definition at line 148 of file Article.php.
References $t.
|
static |
Create an Article object of the appropriate class for the given page.
Title | $title | |
IContextSource | $context |
Definition at line 160 of file Article.php.
References $context, $title, NS_CATEGORY, NS_FILE, and NS_MEDIA.
Referenced by 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 192 of file Article.php.
References $context, WikiPage\getTitle(), and newFromTitle().
Referenced by ApiEditPage\execute(), and MediaWiki\initializeArticle().
|
protected |
Title | $title |
Reimplemented in CategoryPage, and ImagePage.
Definition at line 139 of file Article.php.
References $title.
Referenced by __construct().
Article::pageDataFromId | ( | $dbr, | |
$id, | |||
$options = [] ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2697 of file Article.php.
References $dbr.
Article::pageDataFromTitle | ( | $dbr, | |
$title, | |||
$options = [] ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2705 of file Article.php.
Article::prepareContentForEdit | ( | Content | $content, |
$revision = null, | |||
User | $user = null, | ||
$serialFormat = null, | |||
$useCache = true ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2713 of file Article.php.
References $content.
Article::protect | ( | ) |
Article::protectDescription | ( | array | $limit, |
array | $expiry ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2727 of file Article.php.
Article::protectDescriptionLog | ( | array | $limit, |
array | $expiry ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2735 of file Article.php.
|
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 1361 of file Article.php.
References $cache.
Referenced by LocalFile\recordUpload2().
Article::render | ( | ) |
Handle action=render.
Definition at line 1765 of file Article.php.
References getContext(), and view().
Article::replaceSectionAtRev | ( | $sectionId, | |
Content | $sectionContent, | ||
$sectionTitle = '', | |||
$baseRevId = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2743 of file Article.php.
Article::replaceSectionContent | ( | $sectionId, | |
Content | $sectionContent, | ||
$sectionTitle = '', | |||
$edittime = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2755 of file Article.php.
Article::setContext | ( | $context | ) |
Sets the context this Article is executed in.
IContextSource | $context |
Definition at line 2257 of file Article.php.
References $context.
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 1550 of file Article.php.
References $context, $mRevision, getContext(), Linker\getRevDeleteLink(), getTitle(), Linker\linkKnown(), Linker\revComment(), and Linker\revUserTools().
Referenced by view().
Article::setParserOptions | ( | ParserOptions | $options | ) |
Override the ParserOptions used to render the primary article wikitext.
ParserOptions | $options |
MWException | If the parser options where already initialized. |
Definition at line 2230 of file Article.php.
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 212 of file Article.php.
Article::setTimestamp | ( | $ts | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2767 of file Article.php.
Article::shouldCheckParserCache | ( | ParserOptions | $parserOptions, |
$oldId ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2775 of file Article.php.
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 1507 of file Article.php.
References getContext(), getOldID(), and getTitle().
Referenced by view().
|
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 917 of file Article.php.
References getContext(), getOldID(), getRevisionFetched(), 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 1370 of file Article.php.
References $dbr, $lang, $title, $wgSend404Code, DB_REPLICA, getContext(), getEmptyPageParserOutput(), getOldID(), getRobotPolicy(), getTitle(), NS_MEDIAWIKI, NS_USER, NS_USER_TALK, LogEventsList\showLogExtract(), wfEscapeWikiText(), wfGetDB(), and wfMessage().
Referenced by view().
Article::showNamespaceHeader | ( | ) |
Show a header specific to the namespace currently being viewed, like [[MediaWiki:Talkpagetext]].
For Article::view().
Definition at line 1153 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 mediawiki.page.patrol.ajax.
Definition at line 1188 of file Article.php.
References $cache, $dbr, $title, $wgUseFilePatrol, $wgUseNPPatrol, $wgUseRCPatrol, DB_REPLICA, getContext(), getPermissionManager(), getTitle(), Linker\linkKnown(), 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 1076 of file Article.php.
References $context, $wgRedirectSources, getContext(), getTitle(), isRedirect(), Linker\linkKnown(), and Linker\makeExternalLink().
Referenced by view().
Article::showViewFooter | ( | ) |
Show the footer section of an ordinary page view.
Definition at line 1165 of file Article.php.
References getContext(), getTitle(), NS_USER_TALK, and showPatrolFooter().
Referenced by view().
Article::supportsSections | ( | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2783 of file Article.php.
Article::triggerOpportunisticLinksUpdate | ( | ParserOutput | $parserOutput | ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2791 of file Article.php.
|
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 2151 of file Article.php.
References $cache, getContext(), getTitle(), isFileCacheable(), and wfDebug().
Referenced by view().
Article::unprotect | ( | ) |
Article::updateCategoryCounts | ( | array | $added, |
array | $deleted, | ||
$id = 0 ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2799 of file Article.php.
Article::updateIfNewerOn | ( | $dbw, | |
$revision ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2807 of file Article.php.
Article::updateRedirectOn | ( | $dbw, | |
$redirectTitle, | |||
$lastRevIsRedirect = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2815 of file Article.php.
Article::updateRestrictions | ( | $limit = [], | |
$reason = '', | |||
& | $cascade = 0, | ||
$expiry = [] ) |
array | $limit | |
string | $reason | |
int | &$cascade | |
array | $expiry |
Definition at line 2852 of file Article.php.
References getContext(), and getUser().
Article::updateRevisionOn | ( | $dbw, | |
$revision, | |||
$lastRevision = null, | |||
$lastRevIsRedirect = null ) |
Call to WikiPage function for backwards compatibility.
Definition at line 2823 of file Article.php.
Article::view | ( | ) |
This is the default action of the index.php entry point: just view the page of the given title.
Reimplemented in CategoryPage, and ImagePage.
Definition at line 603 of file Article.php.
References $lang, $wgUseFileCache, adjustDisplayTitle(), fetchContentObject(), fetchRevisionRecord(), getContext(), getOldID(), getPage(), getParserOptions(), getPermissionManager(), getRevIdFetched(), getRevisionRedirectTarget(), getRobotPolicy(), getTitle(), isCurrent(), EditPage\POST_EDIT_COOKIE_KEY_PREFIX, setOldSubtitle(), showDeletedRevisionHeader(), showDiffPage(), showMissingArticle(), showNamespaceHeader(), showRedirectedFromHeader(), showViewFooter(), tryFileCache(), 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 1691 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.
The information in $fetchResult is duplicated by the following deprecated public fields: $mRevIdFetched, $mContentLoaded. $mRevision (and $mContentObject) also typically duplicate information of the loaded revision, but may be overwritten by extensions or due to errors.
Definition at line 100 of file Article.php.
bool Article::$mContentLoaded = false |
Is the target revision loaded? Set by fetchRevisionRecord().
Definition at line 70 of file Article.php.
Content null Article::$mContentObject |
Content of the main slot of $this->mRevision.
Definition at line 62 of file Article.php.
Referenced by fetchContentObject(), and getContentObject().
|
protected |
The context this Article is executed in.
If null, RequestContext::getMain() is used.
Definition at line 43 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 77 of file Article.php.
Referenced by getOldID().
|
protected |
The WikiPage object of this instance.
Definition at line 46 of file Article.php.
Referenced by getPage().
ParserOptions null Article::$mParserOptions |
ParserOptions object for $wgUser articles.
Initialized by getParserOptions by calling $this->mPage->makeParserOptions().
Definition at line 52 of file Article.php.
Referenced by getParserOptions().
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 116 of file Article.php.
Title null Article::$mRedirectedFrom = null |
Title from which we were redirected here, if any.
Definition at line 80 of file Article.php.
Referenced by getRedirectedFrom().
string bool Article::$mRedirectUrl = false |
URL to redirect to or false if none.
Definition at line 83 of file Article.php.
int Article::$mRevIdFetched = 0 |
Revision ID of revision that was loaded.
Definition at line 90 of file Article.php.
Revision null Article::$mRevision = null |
Revision to be shown.
Initialized by getOldIDFromRequest() or fetchContentObject(). Normally loaded from the database, but may be replaced by an extension, or be a fake representing an error message or some such. While the output of Article::view is typically based on this revision, it may be overwritten by error messages or replaced by extensions.
Definition at line 109 of file Article.php.
Referenced by getRevisionFetched(), and setOldSubtitle().
|
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 123 of file Article.php.