MediaWiki REL1_35
Article Class Reference

Class for viewing MediaWiki article and history. More...

Inheritance diagram for Article:
Collaboration diagram for Article:

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.
 
 adjustDisplayTitle (ParserOutput $pOutput)
 Adjust title for pages with displaytitle, -{T|}- or language conversion.
 
 checkFlags ( $flags)
 Call to WikiPage function for backwards compatibility.
 
 checkTouched ()
 
 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)
 
 doEditUpdates (Revision $revision, User $user, array $options=[])
 Call to WikiPage function for backwards compatibility.
 
 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.
 
 followRedirect ()
 
 generateReason (&$hasHistory)
 
 getActionOverrides ()
 Call to WikiPage function for backwards compatibility.
 
 getAutoDeleteReason (&$hasHistory)
 
 getCategories ()
 
 getComment ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null)
 Call to WikiPage function for backwards compatibility.
 
 getContentHandler ()
 
 getContentModel ()
 
 getContext ()
 Gets the context this Article is executed in.
 
 getContributors ()
 
 getCreator ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null)
 Call to WikiPage function for backwards compatibility.
 
 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.
 
 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 ()
 
 getRedirectURL ( $rt)
 
 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 ()
 
 getTitle ()
 Get the title object of the article.
 
 getTouched ()
 
 getUndoContent (Revision $undo, Revision $undoafter=null)
 Call to WikiPage function for backwards compatibility.
 
 getUser ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null)
 
 getUserText ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null)
 
 hasViewableContent ()
 
 insertOn ( $dbw, $pageId=null)
 
 insertProtectNullRevision ( $revCommentMsg, array $limit, array $expiry, $cascade, $reason, $user=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).
 
 isFileCacheable ( $mode=HTMLFileCache::MODE_NORMAL)
 Check if the page can be cached.
 
 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.
 
 protect ()
 action=protect handler
 
 protectDescription (array $limit, array $expiry)
 
 protectDescriptionLog (array $limit, array $expiry)
 
 render ()
 Handle action=render.
 
 replaceSectionAtRev ( $sectionId, Content $sectionContent, $sectionTitle='', $baseRevId=null)
 
 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)
 
 shouldCheckParserCache (ParserOptions $parserOptions, $oldId)
 
 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 ()
 
 triggerOpportunisticLinksUpdate (ParserOutput $parserOutput)
 
 unprotect ()
 action=unprotect handler (alias)
 
 updateCategoryCounts (array $added, array $deleted, $id=0)
 
 updateIfNewerOn ( $dbw, $revision)
 Call to WikiPage function for backwards compatibility.
 
 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.
 
 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->mRevisionRecord.
 
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.
 

Protected Member Functions

 fetchContentObject ()
 Get text content object Does NOT follow redirects.
 
 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

LinkRenderer $linkRenderer
 
IContextSource null $mContext
 The context this Article is executed in.
 
WikiPage $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 mRevisionRecord.
 
 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().
 
 $mRevisionRecord = null
 
PermissionManager $permManager
 
RevisionStore $revisionStore
 

Detailed Description

Class for viewing MediaWiki article and history.

This maintains WikiPage functions for backwards compatibility.

Todo:
Move and rewrite code to an Action class

Note: edit user interface and cache support functions have been moved to separate EditPage and HTMLFileCache classes.

Definition at line 46 of file Article.php.

Constructor & Destructor Documentation

◆ __construct()

Article::__construct ( Title  $title,
  $oldId = null 
)
Parameters
Title$title
int | null$oldIdRevision ID, null to fetch from request, zero for current

Definition at line 159 of file Article.php.

References $title, and newPage().

Member Function Documentation

◆ __get()

Article::__get (   $fname)
Deprecated:
since 1.35, use Article::getPage() instead

Use PHP's magic __get handler to handle accessing of raw WikiPage fields for backwards compatibility, as well as the deprecated $mRevision

Parameters
string$fnameField name
Returns
mixed

Definition at line 2364 of file Article.php.

References fetchRevisionRecord(), and wfDeprecatedMsg().

◆ __set()

Article::__set (   $fname,
  $fvalue 
)
Deprecated:
since 1.35, use Article::getPage() instead

Use PHP's magic __set handler to handle setting of raw WikiPage fields for backwards compatibility, as well as the deprecated $mRevision

Parameters
string$fnameField name
mixed$fvalueNew value

Definition at line 2388 of file Article.php.

References wfDeprecatedMsg().

◆ addHelpLink()

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'.

Parameters
string$toTarget MediaWiki.org page title or encoded URL.
bool$overrideBaseUrlWhether $url is a full URL, to avoid MW.o.
Since
1.25

Definition at line 1808 of file Article.php.

References getContext(), getTitle(), and wfMessage().

Referenced by CategoryPage\closeShowCategory().

◆ adjustDisplayTitle()

Article::adjustDisplayTitle ( ParserOutput  $pOutput)

Adjust title for pages with displaytitle, -{T|}- or language conversion.

Parameters
ParserOutput$pOutput

Definition at line 924 of file Article.php.

References getContext(), and ParserOutput\getTitleText().

Referenced by view().

◆ applyContentOverride()

Article::applyContentOverride ( Content  $override)
private

Applies a content override by constructing a fake Revision object and assigning it to mRevisionRecord.

The fake revision will not have a user, timestamp or summary set.

Todo:
This mechanism was created mainly to accommodate extensions that use the ArticleAfterFetchContentObject. fetchRevisionRecord() presently also uses this mechanism to report errors, but that could be changed to use $this->fetchResult instead.
Todo:
the ArticleAfterFetchContentObject hook was removed; check if this is still needed
Parameters
Content$overrideContent to be used instead of the actual page content, coming from an extension or representing an error message.

Definition at line 558 of file Article.php.

References getTitle().

Referenced by fetchRevisionRecord().

◆ checkFlags()

Article::checkFlags (   $flags)

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35, use WikiPage::exists() instead, or simply omit the EDIT_UPDATE and EDIT_NEW flags. To protect against race conditions, use PageUpdater::grabParentRevision.
See also
WikiPage::checkFlags
Parameters
int$flags
Returns
int

Definition at line 2420 of file Article.php.

References wfDeprecated().

◆ checkTouched()

Article::checkTouched ( )
Deprecated:
since 1.35, use WikiPage::checkTouched instead
See also
WikiPage::checkTouched
Returns
bool

Definition at line 2430 of file Article.php.

References wfDeprecated().

◆ clear()

Article::clear ( )

Clear the object.

Definition at line 272 of file Article.php.

◆ clearPreparedEdit()

Article::clearPreparedEdit ( )

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35, use WikiPage::clearPreparedEdit instead
See also
WikiPage::clearPreparedEdit

Definition at line 2440 of file Article.php.

References wfDeprecated().

◆ commitRollback()

Article::commitRollback (   $fromP,
  $summary,
  $bot,
$resultDetails,
User  $guser = null 
)
Deprecated:
since 1.35

Definition at line 3219 of file Article.php.

References getContext(), and wfDeprecated().

◆ confirmDelete()

Article::confirmDelete (   $reason)

Output deletion confirmation dialog.

Todo:
Move to another file?
Parameters
string$reasonPrefilled reason

Definition at line 1983 of file Article.php.

References $title, getContext(), getTitle(), Message\numParam(), wfDebug(), and wfMessage().

Referenced by delete().

◆ delete()

Article::delete ( )

◆ doDelete()

Article::doDelete (   $reason,
  $suppress = false,
  $immediate = false 
)

Perform a deletion and output success or failure messages.

Parameters
string$reason
bool$suppress
bool$immediatefalse allows deleting over time via the job queue
Exceptions
FatalError
MWException

Definition at line 2172 of file Article.php.

References getContext(), getTitle(), wfEscapeWikiText(), and wfMessage().

Referenced by delete().

◆ doDeleteArticle()

Article::doDeleteArticle (   $reason,
  $suppress = false,
  $u1 = null,
  $u2 = null,
$error = '',
  $immediate = false 
)
Deprecated:
since 1.35, use WikiPage::doDeleteArticleReal instead
Parameters
string$reason
bool$suppress
int | null$u1Unused
bool | null$u2Unused
string&$error
bool$immediatefalse allows deleting over time via the job queue
Returns
bool
Exceptions
FatalError
MWException

Definition at line 3175 of file Article.php.

References wfDeprecated().

◆ doDeleteArticleReal()

Article::doDeleteArticleReal (   $reason,
  $suppress = false,
  $u1 = null,
  $u2 = null,
$error = '',
User  $user = null,
  $tags = [],
  $immediate = false 
)

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35
See also
WikiPage::doDeleteArticleReal
Parameters
string$reason
bool$suppress
int | null$u1
bool | null$u2
array | string&$error
User | null$user
array$tags
bool$immediate
Returns
Status

Definition at line 2459 of file Article.php.

References wfDeprecated().

◆ doDeleteUpdates()

Article::doDeleteUpdates (   $id,
Content  $content = null,
  $revision = null,
User  $user = null 
)
Deprecated:
since 1.35, use WikiPage::doDeleteUpdates instead
See also
WikiPage::doDeleteUpdates
Parameters
int$id
Content | null$content
Revision | null$revision
User | null$user

Definition at line 2477 of file Article.php.

References $content, and wfDeprecated().

◆ doEditUpdates()

Article::doEditUpdates ( Revision  $revision,
User  $user,
array  $options = [] 
)

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35, use PageUpdater::doUpdates instead.
See also
WikiPage::doEditUpdates
Parameters
Revision$revision
User$user
array$options

Definition at line 2496 of file Article.php.

References wfDeprecated().

◆ doPurge()

Article::doPurge ( )
Deprecated:
since 1.35, use WikiPage::doPurge instead
See also
WikiPage::doPurge
Note
In 1.28 (and only 1.28), this took a $flags parameter that controlled how much purging was done.
Returns
bool

Definition at line 2508 of file Article.php.

References wfDeprecated().

◆ doRollback()

Article::doRollback (   $fromP,
  $summary,
  $token,
  $bot,
$resultDetails,
User  $user = null 
)
Deprecated:
since 1.35
Parameters
string$fromP
string$summary
string$token
bool$bot
array&$resultDetails
User | null$user
Returns
array[]

Definition at line 3193 of file Article.php.

References getContext(), and wfDeprecated().

◆ doUpdateRestrictions()

Article::doUpdateRestrictions ( array  $limit,
array  $expiry,
$cascade,
  $reason,
User  $user 
)
Deprecated:
since 1.35, use WikiPage::doUpdateRestrictions instead
Parameters
array$limit
array$expiry
bool&$cascade
string$reason
User$user
Returns
Status

Definition at line 3135 of file Article.php.

References wfDeprecated().

◆ doViewUpdates()

Article::doViewUpdates ( User  $user,
  $oldid = 0 
)
Deprecated:
since 1.35, use WikiPage::doViewUpdates instead
See also
WikiPage::doViewUpdates
Parameters
User$user
int$oldid

Definition at line 2519 of file Article.php.

References wfDeprecated().

◆ exists()

Article::exists ( )
Deprecated:
since 1.35, use WikiPage::exists instead
See also
WikiPage::exists
Returns
bool

Definition at line 2529 of file Article.php.

References wfDeprecated().

Referenced by ImagePage\imageHistory().

◆ fetchContentObject()

Article::fetchContentObject ( )
protected

Get text content object Does NOT follow redirects.

Todo:
When is this null?
Deprecated:
since 1.32, use fetchRevisionRecord() instead.
Note
Code that wants to retrieve page content from the database should use WikiPage::getContent().
Returns
Content|null|bool
Since
1.21

Definition at line 448 of file Article.php.

References fetchRevisionRecord().

Referenced by getContentObject().

◆ fetchRevisionRecord()

Article::fetchRevisionRecord ( )

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.

Public since 1.35

Returns
RevisionRecord|null

Definition at line 467 of file Article.php.

References applyContentOverride(), getContext(), getOldID(), getTitle(), getUser(), makeFetchErrorContent(), and wfDebug().

Referenced by __get(), fetchContentObject(), getRevisionFetched(), showDiffPage(), and view().

◆ followRedirect()

Article::followRedirect ( )
Deprecated:
since 1.35, use WikiPage::followRedirect instead
See also
WikiPage::followRedirect
Returns
bool|Title|string

Definition at line 2539 of file Article.php.

References wfDeprecated().

◆ formatRobotPolicy()

static Article::formatRobotPolicy (   $policy)
static

Converts a String robot policy into an associative array, to allow merging of several policies using array_merge().

Parameters
array | string$policyReturns empty array on null/false/'', transparent to already-converted arrays, converts string.
Returns
array 'index' => \<indexpolicy\>, 'follow' => \<followpolicy\>

Definition at line 1076 of file Article.php.

◆ generateReason()

Article::generateReason ( $hasHistory)
Deprecated:
since 1.35, use WikiPage::getAutoDeleteReason instead
Parameters
bool&$hasHistory
Returns
mixed

Definition at line 3234 of file Article.php.

References getPage(), and wfDeprecated().

◆ getActionOverrides()

Article::getActionOverrides ( )

Call to WikiPage function for backwards compatibility.

See also
ContentHandler::getActionOverrides
Returns
array

Definition at line 2549 of file Article.php.

◆ getAutoDeleteReason()

Article::getAutoDeleteReason ( $hasHistory)
Deprecated:
since 1.35, use WikiPage::getAutoDeleteReason instead
See also
WikiPage::getAutoDeleteReason
Parameters
bool&$hasHistory
Returns
string|bool

Definition at line 2559 of file Article.php.

References wfDeprecated().

◆ getCategories()

Article::getCategories ( )
Deprecated:
since 1.35, use WikiPage::getCategories instead
See also
WikiPage::getCategories
Returns
TitleArray

Definition at line 2569 of file Article.php.

References wfDeprecated().

◆ getComment()

Article::getComment (   $audience = RevisionRecord::FOR_PUBLIC,
User  $user = null 
)

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35
See also
WikiPage::getComment
Parameters
int$audience
User | null$user
Returns
string|null

Definition at line 2582 of file Article.php.

References wfDeprecated().

◆ getContentHandler()

Article::getContentHandler ( )
Deprecated:
since 1.35, use WikiPage::getContentHandler instead
See also
WikiPage::getContentHandler
Returns
ContentHandler

Definition at line 2592 of file Article.php.

References wfDeprecated().

◆ getContentModel()

Article::getContentModel ( )
Deprecated:
since 1.35, use WikiPage::getContentModel instead
See also
WikiPage::getContentModel
Returns
string

Definition at line 2602 of file Article.php.

References wfDeprecated().

◆ getContentObject()

Article::getContentObject ( )
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.

Deprecated:
since 1.32, use fetchRevisionRecord() instead.
Returns
Content
Since
1.21

Definition at line 304 of file Article.php.

References $content, fetchContentObject(), and getSubstituteContent().

◆ getContext()

Article::getContext ( )

Gets the context this Article is executed in.

Returns
IContextSource
Since
1.18

Definition at line 2345 of file Article.php.

References wfDebug().

Referenced by ImageHistoryList\__construct(), EditPage\__construct(), and ProtectionForm\__construct().

◆ getContributors()

Article::getContributors ( )
Deprecated:
since 1.35, use WikiPage::getContributors instead
See also
WikiPage::getContributors
Returns
UserArrayFromResult

Definition at line 2612 of file Article.php.

References wfDeprecated().

◆ getCreator()

Article::getCreator (   $audience = RevisionRecord::FOR_PUBLIC,
User  $user = null 
)

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35
See also
WikiPage::getCreator
Parameters
int$audience
User | null$user
Returns
User|null

Definition at line 2625 of file Article.php.

References wfDeprecated().

◆ getDeletionUpdates()

Article::getDeletionUpdates ( Content  $content = null)
Deprecated:
since 1.35, use WikiPage::getDeletionUpdates instead
See also
WikiPage::getDeletionUpdates
Parameters
Content | null$content
Returns
DeferrableUpdate[]

Definition at line 2636 of file Article.php.

References $content, and wfDeprecated().

◆ getEmptyPageParserOutput()

Article::getEmptyPageParserOutput ( ParserOptions  $options)
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.

Parameters
ParserOptions$options
Returns
ParserOutput

Reimplemented in ImagePage.

Definition at line 347 of file Article.php.

References $content, getSubstituteContent(), and getTitle().

Referenced by showMissingArticle().

◆ getHiddenCategories()

Article::getHiddenCategories ( )
Deprecated:
since 1.35, use WikiPage::getHiddenCategories instead
See also
WikiPage::getHiddenCategories
Returns
array

Definition at line 2646 of file Article.php.

References wfDeprecated().

◆ getId()

Article::getId ( )
Deprecated:
since 1.35, use WikiPage::getId instead
See also
WikiPage::getId
Returns
int

Definition at line 2656 of file Article.php.

References wfDeprecated().

Referenced by ImagePage\getEmptyPageParserOutput(), ImagePage\openShowImage(), ImagePage\printSharedImageText(), and ImagePage\view().

◆ getLatest()

Article::getLatest ( )
Deprecated:
since 1.35, use WikiPage::getLatest instead
See also
WikiPage::getLatest
Returns
int

Definition at line 2666 of file Article.php.

References wfDeprecated().

◆ getLinksTimestamp()

Article::getLinksTimestamp ( )
Deprecated:
since 1.35, use WikiPage::getLinksTimestamp instead
See also
WikiPage::getLinksTimestamp
Returns
string|null

Definition at line 2676 of file Article.php.

References wfDeprecated().

◆ getMinorEdit()

Article::getMinorEdit ( )
Deprecated:
since 1.35, use WikiPage::getMinorEdit instead
See also
WikiPage::getMinorEdit
Returns
bool

Definition at line 2686 of file Article.php.

References wfDeprecated().

◆ getOldestRevision()

Article::getOldestRevision ( )
Deprecated:
since 1.35, use RevisionStore::getFirstRevision
Returns
Revision|null

Definition at line 2695 of file Article.php.

References wfDeprecated().

◆ getOldID()

Article::getOldID ( )
See also
getOldIDFromRequest()
getRevIdFetched()
Returns
int The oldid of the article that is was requested in the constructor or via the context's WebRequest.

Definition at line 360 of file Article.php.

References getOldIDFromRequest().

Referenced by fetchRevisionRecord(), isCurrent(), showDeletedRevisionHeader(), showDiffPage(), showMissingArticle(), view(), and ImagePage\view().

◆ getOldIDFromRequest()

Article::getOldIDFromRequest ( )

Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect.

Returns
int The old id for the request

Definition at line 373 of file Article.php.

References getContext(), and getTitle().

Referenced by getOldID().

◆ getPage()

◆ getParserOptions()

Article::getParserOptions ( )

Get parser options suitable for rendering the primary article wikitext.

Returns
ParserOptions

Definition at line 2321 of file Article.php.

References getContext().

Referenced by getParserOutput(), and view().

◆ getParserOutput()

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.

Since
1.16 (r52326) for LiquidThreads
Parameters
int | null$oldidRevision ID or null
User | null$userThe relevant user
Returns
ParserOutput|bool ParserOutput or false if the given revision ID is not found

Definition at line 2290 of file Article.php.

References getParserOptions().

◆ getRedirectedFrom()

Article::getRedirectedFrom ( )

Get the page this view was redirected from.

Returns
Title|null
Since
1.28

Definition at line 237 of file Article.php.

◆ getRedirectHeaderHtml()

static Article::getRedirectHeaderHtml ( Language  $lang,
  $target,
  $forceKnown = false 
)
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.

Since
1.23
Parameters
Language$lang
Title | Title[]$targetDestination(s) to redirect
bool$forceKnownShould the image be shown as a bluelink regardless of existence?
Returns
string Containing HTML with redirect link

Definition at line 1761 of file Article.php.

References $lang, $title, MediaWiki\Linker\LinkRenderer\makeKnownLink(), MediaWiki\Linker\LinkRenderer\makeLink(), and wfMessage().

◆ getRedirectTarget()

Article::getRedirectTarget ( )
Deprecated:
since 1.35, use WikiPage::getRedirectTarget instead
See also
WikiPage::getRedirectTarget
Returns
Title|null

Definition at line 2705 of file Article.php.

References wfDeprecated().

◆ getRedirectURL()

Article::getRedirectURL (   $rt)
Deprecated:
since 1.35, use WikiPage::getRedirectURL instead
See also
WikiPage::getRedirectURL
Parameters
Title$rt
Returns
bool|Title|string

Definition at line 2716 of file Article.php.

References wfDeprecated().

◆ getRevIdFetched()

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.

Returns
int Revision ID of last article revision

Definition at line 611 of file Article.php.

Referenced by view().

◆ getRevision()

Article::getRevision ( )

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35
See also
WikiPage::getRevision
Returns
Revision|null

Definition at line 2727 of file Article.php.

References wfDeprecated().

◆ getRevisionFetched()

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.

Deprecated:
since 1.35
Since
1.19
Returns
Revision|null

Definition at line 596 of file Article.php.

References fetchRevisionRecord(), and wfDeprecated().

◆ getRevisionRedirectTarget()

Article::getRevisionRedirectTarget ( RevisionRecord  $revision)
private
Parameters
RevisionRecord$revision
Returns
null|Title

Definition at line 912 of file Article.php.

References $content, and MediaWiki\Revision\RevisionRecord\getContent().

Referenced by view().

◆ getRobotPolicy()

Article::getRobotPolicy (   $action,
ParserOutput  $pOutput = null 
)

Get the robot policy to be used for the current view.

Parameters
string$actionThe action= GET parameter
ParserOutput | null$pOutput
Returns
array The policy that should be set
Todo:
actions other than 'view'

Definition at line 996 of file Article.php.

References $wgArticleRobotPolicies, $wgDefaultRobotPolicy, $wgNamespaceRobotPolicies, getContext(), getTitle(), NS_USER, and NS_USER_TALK.

Referenced by showMissingArticle(), and view().

◆ getSubstituteContent()

Article::getSubstituteContent ( )
private

Returns Content object to use when the page does not exist.

Returns
Content

Definition at line 320 of file Article.php.

References $content, getContext(), getTitle(), and NS_MEDIAWIKI.

Referenced by getContentObject(), and getEmptyPageParserOutput().

◆ getTimestamp()

Article::getTimestamp ( )
Deprecated:
since 1.35, use WikiPage::getTimestamp instead
See also
WikiPage::getTimestamp
Returns
string

Definition at line 2737 of file Article.php.

References wfDeprecated().

◆ getTitle()

Article::getTitle ( )

Get the title object of the article.

Returns
Title Title object of this page

Definition at line 255 of file Article.php.

Referenced by ImageHistoryList\__construct(), EditPage\__construct(), and ProtectionForm\__construct().

◆ getTouched()

Article::getTouched ( )
Deprecated:
since 1.35, use WikiPage::getTouched instead
See also
WikiPage::getTouched
Returns
string

Definition at line 2747 of file Article.php.

References wfDeprecated().

Referenced by CategoryPage\view().

◆ getUndoContent()

Article::getUndoContent ( Revision  $undo,
Revision  $undoafter = null 
)

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35
See also
WikiPage::getUndoContent
Parameters
Revision$undo
Revision | null$undoafter
Returns
Content|bool

Definition at line 2760 of file Article.php.

References wfDeprecated().

◆ getUser()

Article::getUser (   $audience = RevisionRecord::FOR_PUBLIC,
User  $user = null 
)
Deprecated:
since 1.35, use WikiPage::getUser instead
See also
WikiPage::getUser
Parameters
int$audience
User | null$user
Returns
int

Definition at line 2772 of file Article.php.

References wfDeprecated().

◆ getUserText()

Article::getUserText (   $audience = RevisionRecord::FOR_PUBLIC,
User  $user = null 
)
Deprecated:
since 1.35, use WikiPage::getUserText instead
See also
WikiPage::getUserText
Parameters
int$audience
User | null$user
Returns
string

Definition at line 2784 of file Article.php.

References wfDeprecated().

◆ hasViewableContent()

Article::hasViewableContent ( )
Deprecated:
since 1.35, use WikiPage::hasViewableContent instead
See also
WikiPage::hasViewableContent
Returns
bool

Definition at line 2794 of file Article.php.

References wfDeprecated().

◆ insertOn()

Article::insertOn (   $dbw,
  $pageId = null 
)
Deprecated:
since 1.35, use WikiPage::insertOn instead
See also
WikiPage::insertOn
Parameters
IDatabase$dbw
int | null$pageId
Returns
bool|int

Definition at line 2806 of file Article.php.

References wfDeprecated().

◆ insertProtectNullRevision()

Article::insertProtectNullRevision (   $revCommentMsg,
array  $limit,
array  $expiry,
  $cascade,
  $reason,
  $user = null 
)
See also
WikiPage::insertProtectNullRevision
Deprecated:
since 1.35, use WikiPage::insertNullProtectionRevision instead
Parameters
string$revCommentMsg
array$limit
array$expiry
int$cascade
string$reason
User | null$user
Returns
Revision|null

Definition at line 2822 of file Article.php.

References wfDeprecated().

◆ insertRedirect()

Article::insertRedirect ( )
Deprecated:
since 1.35, use WikiPage::insertRedirect instead
See also
WikiPage::insertRedirect
Returns
Title|null

Definition at line 2836 of file Article.php.

References wfDeprecated().

◆ insertRedirectEntry()

Article::insertRedirectEntry ( Title  $rt,
  $oldLatest = null 
)
Deprecated:
since 1.35, use WikiPage::insertRedirectEntry instead
See also
WikiPage::insertRedirectEntry
Parameters
Title$rt
int | null$oldLatest
Returns
bool

Definition at line 2848 of file Article.php.

References wfDeprecated().

◆ isCountable()

Article::isCountable (   $editInfo = false)
Deprecated:
since 1.35, use WikiPage::isCountable instead
See also
WikiPage::isCountable
Parameters
PreparedEdit | bool$editInfo
Returns
bool

Definition at line 2859 of file Article.php.

References wfDeprecated().

◆ isCurrent()

Article::isCurrent ( )

Returns true if the currently-referenced revision is the current edit to this page (and it exists).

Returns
bool

Definition at line 574 of file Article.php.

References getOldID().

Referenced by view().

◆ isFileCacheable()

Article::isFileCacheable (   $mode = HTMLFileCache::MODE_NORMAL)

Check if the page can be cached.

Parameters
int$modeOne of the HTMLFileCache::MODE_* constants (since 1.28)
Returns
bool

Definition at line 2262 of file Article.php.

References getContext(), getTitle(), and HTMLFileCache\useFileCache().

Referenced by tryFileCache().

◆ isRedirect()

Article::isRedirect ( )
Deprecated:
since 1.35, use WikiPage::isRedirect instead
See also
WikiPage::isRedirect
Returns
bool

Definition at line 2869 of file Article.php.

References wfDeprecated().

Referenced by showRedirectedFromHeader().

◆ loadFromRow()

Article::loadFromRow (   $data,
  $from 
)
Deprecated:
since 1.35, use WikiPage::loadFromRow instead
See also
WikiPage::loadFromRow
Parameters
object | bool$data
string | int$from

Definition at line 2880 of file Article.php.

References wfDeprecated().

◆ loadPageData()

Article::loadPageData (   $from = 'fromdb')
Deprecated:
since 1.35, use WikiPage::loadPageData instead
See also
WikiPage::loadPageData
Parameters
object | string | int$from

Definition at line 2890 of file Article.php.

References wfDeprecated().

◆ lockAndGetLatest()

Article::lockAndGetLatest ( )
Deprecated:
since 1.35, use WikiPage::lockAndGetLatest instead
See also
WikiPage::lockAndGetLatest
Returns
int

Definition at line 2900 of file Article.php.

References wfDeprecated().

◆ makeFetchErrorContent()

Article::makeFetchErrorContent ( )
private

Returns a Content object representing any error in $this->fetchContent, or null if there is no such error.

Returns
Content|null

Definition at line 537 of file Article.php.

Referenced by fetchRevisionRecord().

◆ makeParserOptions()

Article::makeParserOptions (   $context)
Deprecated:
since 1.35, use WikiPage::makeParserOptions instead
See also
WikiPage::makeParserOptions
Parameters
IContextSource | User | string$context
Returns
ParserOptions

Definition at line 2911 of file Article.php.

References wfDeprecated().

◆ newFromID()

static Article::newFromID (   $id)
static

Constructor from a page id.

Parameters
int$idArticle ID to load
Returns
Article|null

Definition at line 182 of file Article.php.

References $t.

◆ newFromTitle()

static Article::newFromTitle (   $title,
IContextSource  $context 
)
static

Create an Article object of the appropriate class for the given page.

Parameters
Title$title
IContextSource$context
Returns
Article

Definition at line 194 of file Article.php.

References $title, NS_CATEGORY, NS_FILE, and NS_MEDIA.

◆ newFromWikiPage()

static Article::newFromWikiPage ( WikiPage  $page,
IContextSource  $context 
)
static

Create an Article object of the appropriate class for the given page.

Parameters
WikiPage$page
IContextSource$context
Returns
Article

Definition at line 226 of file Article.php.

References WikiPage\getTitle().

◆ newPage()

Article::newPage ( Title  $title)
protected
Parameters
Title$title
Returns
WikiPage

Reimplemented in CategoryPage, and ImagePage.

Definition at line 173 of file Article.php.

References $title.

Referenced by __construct().

◆ pageDataFromId()

Article::pageDataFromId (   $dbr,
  $id,
  $options = [] 
)
Deprecated:
since 1.35, use WikiPage::pageDataFromId instead
See also
WikiPage::pageDataFromId
Parameters
IDatabase$dbr
int$id
array$options
Returns
object|bool

Definition at line 2924 of file Article.php.

References $dbr, and wfDeprecated().

◆ pageDataFromTitle()

Article::pageDataFromTitle (   $dbr,
  $title,
  $options = [] 
)
Deprecated:
since 1.35, use WikiPage::pageDataFromTitle instead
See also
WikiPage::pageDataFromTitle
Parameters
IDatabase$dbr
Title$title
array$options
Returns
object|bool

Definition at line 2937 of file Article.php.

References $dbr, $title, and wfDeprecated().

◆ prepareContentForEdit()

Article::prepareContentForEdit ( Content  $content,
  $revision = null,
User  $user = null,
  $serialFormat = null,
  $useCache = true 
)

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35 with PreparedEdit. use
See also
\MediaWiki\Storage\DerivedPageDataUpdater instead.
WikiPage::prepareContentForEdit
Parameters
Content$content
Revision | RevisionRecord | null$revision
User | null$user
string | null$serialFormat
bool$useCache
Returns
PreparedEdit

Definition at line 2955 of file Article.php.

References $content, and wfDeprecated().

◆ protect()

Article::protect ( )

action=protect handler

Definition at line 1836 of file Article.php.

Referenced by unprotect().

◆ protectDescription()

Article::protectDescription ( array  $limit,
array  $expiry 
)
Deprecated:
since 1.35, use WikiPage::protectDescription instead
See also
WikiPage::protectDescription
Parameters
array$limit
array$expiry
Returns
string

Definition at line 2973 of file Article.php.

References wfDeprecated().

◆ protectDescriptionLog()

Article::protectDescriptionLog ( array  $limit,
array  $expiry 
)
Deprecated:
since 1.35, use WikiPage::protectDescriptionLog instead
See also
WikiPage::protectDescriptionLog
Parameters
array$limit
array$expiry
Returns
string

Definition at line 2985 of file Article.php.

References wfDeprecated().

◆ purgePatrolFooterCache()

static Article::purgePatrolFooterCache (   $articleID)
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.

Parameters
int$articleIDID of the article to purge
Since
1.27

Definition at line 1384 of file Article.php.

References $cache.

◆ render()

Article::render ( )

Handle action=render.

Definition at line 1825 of file Article.php.

References getContext(), and view().

◆ replaceSectionAtRev()

Article::replaceSectionAtRev (   $sectionId,
Content  $sectionContent,
  $sectionTitle = '',
  $baseRevId = null 
)
Deprecated:
since 1.35, use WikiPage::replaceSectionAtRev instead
See also
WikiPage::replaceSectionAtRev
Parameters
string | int | null | bool$sectionId
Content$sectionContent
string$sectionTitle
int | null$baseRevId
Returns
Content|null

Definition at line 2999 of file Article.php.

References wfDeprecated().

◆ replaceSectionContent()

Article::replaceSectionContent (   $sectionId,
Content  $sectionContent,
  $sectionTitle = '',
  $edittime = null 
)

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35, use WikiPage::replaceSectionAtRev instead
See also
WikiPage::replaceSectionContent
Parameters
string | int | null | bool$sectionId
Content$sectionContent
string$sectionTitle
string | null$edittime
Returns
Content|null

Definition at line 3019 of file Article.php.

References wfDeprecated().

◆ setContext()

Article::setContext (   $context)

Sets the context this Article is executed in.

Parameters
IContextSource$context
Since
1.18

Definition at line 2335 of file Article.php.

◆ setOldSubtitle()

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 -\>

Parameters
int$oldidRevision ID of this article revision

Definition at line 1588 of file Article.php.

References getContext(), Linker\getRevDeleteLink(), getTitle(), Linker\revComment(), and Linker\revUserTools().

Referenced by view().

◆ setParserOptions()

Article::setParserOptions ( ParserOptions  $options)

Override the ParserOptions used to render the primary article wikitext.

Parameters
ParserOptions$options
Exceptions
MWExceptionIf the parser options where already initialized.

Definition at line 2308 of file Article.php.

◆ setRedirectedFrom()

Article::setRedirectedFrom ( Title  $from)

Tell the page view functions that this view was redirected from another page on the wiki.

Parameters
Title$from

Definition at line 246 of file Article.php.

◆ setTimestamp()

Article::setTimestamp (   $ts)
Deprecated:
since 1.35, use WikiPage::setTimestamp instead
See also
WikiPage::setTimestamp
Parameters
string$ts

Definition at line 3033 of file Article.php.

References wfDeprecated().

◆ shouldCheckParserCache()

Article::shouldCheckParserCache ( ParserOptions  $parserOptions,
  $oldId 
)
Deprecated:
since 1.35, use WikiPage::shouldCheckParserCache instead
See also
WikiPage::shouldCheckParserCache
Parameters
ParserOptions$parserOptions
int$oldId
Returns
bool

Definition at line 3045 of file Article.php.

References wfDeprecated().

◆ showDeletedRevisionHeader()

Article::showDeletedRevisionHeader ( )

If the revision requested for view is deleted, check permissions.

Send either an error message or a warning header to the output.

Returns
bool True if the view is allowed, false if not.

Definition at line 1541 of file Article.php.

References getContext(), getOldID(), and getTitle().

Referenced by view().

◆ showDiffPage()

Article::showDiffPage ( )
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 939 of file Article.php.

References fetchRevisionRecord(), getContext(), getOldID(), and wfMessage().

Referenced by view().

◆ showMissingArticle()

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 1393 of file Article.php.

References $dbr, $lang, $title, $wgSend404Code, DB_REPLICA, getContext(), getEmptyPageParserOutput(), getOldID(), getRobotPolicy(), getTitle(), User\isIP(), User\newFromName(), NS_MEDIAWIKI, NS_USER, NS_USER_TALK, wfEscapeWikiText(), wfGetDB(), and wfMessage().

Referenced by view().

◆ showNamespaceHeader()

Article::showNamespaceHeader ( )

Show a header specific to the namespace currently being viewed, like [[MediaWiki:Talkpagetext]].

For Article::view().

Definition at line 1179 of file Article.php.

References getContext(), getTitle(), and wfMessage().

Referenced by view().

◆ showPatrolFooter()

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.

Returns
bool

Definition at line 1215 of file Article.php.

References $cache, $dbr, $title, $wgUseFilePatrol, $wgUseNPPatrol, $wgUseRCPatrol, DB_REPLICA, getContext(), getTitle(), NS_FILE, RC_LOG, wfGetDB(), and wfMessage().

Referenced by showViewFooter().

◆ showRedirectedFromHeader()

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.

Returns
bool

Definition at line 1105 of file Article.php.

References $wgRedirectSources, getContext(), getTitle(), isRedirect(), and Linker\makeExternalLink().

Referenced by view().

◆ showViewFooter()

Article::showViewFooter ( )

Show the footer section of an ordinary page view.

Definition at line 1191 of file Article.php.

References getContext(), getTitle(), NS_USER_TALK, and showPatrolFooter().

Referenced by view().

◆ supportsSections()

Article::supportsSections ( )
Deprecated:
since 1.35, use WikiPage::supportsSections instead
See also
WikiPage::supportsSections
Returns
bool

Definition at line 3055 of file Article.php.

References wfDeprecated().

◆ triggerOpportunisticLinksUpdate()

Article::triggerOpportunisticLinksUpdate ( ParserOutput  $parserOutput)
Deprecated:
since 1.35, use WikiPage::triggerOpportunisticLinksUpdate instead
See also
WikiPage::triggerOpportunisticLinksUpdate
Parameters
ParserOutput$parserOutput

Definition at line 3065 of file Article.php.

References wfDeprecated().

◆ tryFileCache()

Article::tryFileCache ( )
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)

Returns
bool True if cached version send, false otherwise

Definition at line 2231 of file Article.php.

References $cache, getContext(), getTitle(), isFileCacheable(), and wfDebug().

Referenced by view().

◆ unprotect()

Article::unprotect ( )

action=unprotect handler (alias)

Definition at line 1844 of file Article.php.

References protect().

◆ updateCategoryCounts()

Article::updateCategoryCounts ( array  $added,
array  $deleted,
  $id = 0 
)
Deprecated:
since 1.35, use WikiPage::updateCategoryCounts instead
See also
WikiPage::updateCategoryCounts
Parameters
array$added
array$deleted
int$id

Definition at line 3077 of file Article.php.

References wfDeprecated().

◆ updateIfNewerOn()

Article::updateIfNewerOn (   $dbw,
  $revision 
)

Call to WikiPage function for backwards compatibility.

Deprecated:
since 1.35
See also
WikiPage::updateIfNewerOn
Parameters
IDatabase$dbw
Revision$revision
Returns
bool

Definition at line 3090 of file Article.php.

References wfDeprecated().

◆ updateRedirectOn()

Article::updateRedirectOn (   $dbw,
  $redirectTitle,
  $lastRevIsRedirect = null 
)
Deprecated:
since 1.35, use WikiPage::updateRedirectOn instead
See also
WikiPage::updateRedirectOn
Parameters
IDatabase$dbw
Title | null$redirectTitle
null | bool$lastRevIsRedirect
Returns
bool

Definition at line 3103 of file Article.php.

References wfDeprecated().

◆ updateRestrictions()

Article::updateRestrictions (   $limit = [],
  $reason = '',
$cascade = 0,
  $expiry = [] 
)
Deprecated:
since 1.35, use WikiPage::updateRestrictions
Parameters
array$limit
string$reason
int&$cascade
array$expiry
Returns
bool

Definition at line 3150 of file Article.php.

References getContext(), getUser(), and wfDeprecated().

◆ updateRevisionOn()

Article::updateRevisionOn (   $dbw,
  $revision,
  $lastRevision = null,
  $lastRevIsRedirect = null 
)
Deprecated:
since 1.35, use WikiPage::updateRevisionOn instead
See also
WikiPage::updateRevisionOn
Parameters
IDatabase$dbw
Revision$revision
int | null$lastRevision
bool | null$lastRevIsRedirect
Returns
bool

Definition at line 3117 of file Article.php.

References wfDeprecated().

◆ view()

◆ viewRedirect()

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.

Parameters
Title | array$targetDestination(s) to redirect
bool$appendSubtitle[optional]
bool$forceKnownShould the image be shown as a bluelink regardless of existence?
Returns
string Containing HTML with redirect link
Deprecated:
since 1.30

Definition at line 1739 of file Article.php.

References $lang, getContext(), getTitle(), and wfMessage().

Member Data Documentation

◆ $fetchResult

Status null Article::$fetchResult = null
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 (and $mContentObject) also typically duplicate information of the loaded revision, but may be overwritten by extensions or due to errors.

Definition at line 111 of file Article.php.

◆ $linkRenderer

LinkRenderer Article::$linkRenderer
protected

◆ $mContentLoaded

bool Article::$mContentLoaded = false

Is the target revision loaded? Set by fetchRevisionRecord().

Deprecated:
since 1.32. Whether content has been loaded should not be relevant to code outside this class.

Definition at line 81 of file Article.php.

◆ $mContentObject

Content null Article::$mContentObject

Content of the main slot of $this->mRevisionRecord.

Note
This variable is read only, setting it has no effect. Extensions that wish to override the output of Article::view should use a hook.
Todo:
MCR: Remove in 1.33
Deprecated:
since 1.32
Since
1.21

Definition at line 73 of file Article.php.

◆ $mContext

IContextSource null Article::$mContext
protected

The context this Article is executed in.

If null, RequestContext::getMain() is used.

Deprecated:
since 1.35, must be private, use getContext

Definition at line 54 of file Article.php.

◆ $mOldId

int null Article::$mOldId

The oldid of the article that was requested to be shown, 0 for the current revision.

See also
$mRevIdFetched

Definition at line 88 of file Article.php.

◆ $mPage

WikiPage Article::$mPage
protected

The WikiPage object of this instance.

Definition at line 57 of file Article.php.

◆ $mParserOptions

ParserOptions null Article::$mParserOptions

ParserOptions object for $wgUser articles.

Initialized by getParserOptions by calling $this->mPage->makeParserOptions().

Definition at line 63 of file Article.php.

◆ $mParserOutput

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.

Deprecated:
since 1.32

Definition at line 118 of file Article.php.

◆ $mRedirectedFrom

Title null Article::$mRedirectedFrom = null

Title from which we were redirected here, if any.

Definition at line 91 of file Article.php.

◆ $mRedirectUrl

string bool Article::$mRedirectUrl = false

URL to redirect to or false if none.

Definition at line 94 of file Article.php.

◆ $mRevIdFetched

int Article::$mRevIdFetched = 0

Revision ID of revision that was loaded.

See also
$mOldId
Deprecated:
since 1.32, use getRevIdFetched() instead.

Definition at line 101 of file Article.php.

◆ $mRevisionRecord

Article::$mRevisionRecord = null
private

Definition at line 153 of file Article.php.

◆ $permManager

PermissionManager Article::$permManager
private

Definition at line 135 of file Article.php.

◆ $revisionStore

RevisionStore Article::$revisionStore
private

Definition at line 140 of file Article.php.

◆ $viewIsRenderAction

bool Article::$viewIsRenderAction = false
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 125 of file Article.php.


The documentation for this class was generated from the following file: