MediaWiki fundraising/REL1_35
|
Class representing a MediaWiki article and history. More...
Public Member Functions | |
__clone () | |
Makes sure that the mTitle object is cloned to the newly cloned WikiPage. | |
__construct (Title $title) | |
checkFlags ( $flags) | |
Check flags and add EDIT_NEW or EDIT_UPDATE to them as needed. | |
checkTouched () | |
Loads page_touched and returns a value indicating if it should be used. | |
clear () | |
Clear the object. | |
clearPreparedEdit () | |
Clear the mPreparedEdit cache field, as may be needed by mutable content types. | |
commitRollback ( $fromP, $summary, $bot, &$resultDetails, User $guser, $tags=null) | |
Backend implementation of doRollback(), please refer there for parameter and return value documentation. | |
doDeleteArticle ( $reason, $suppress=false, $u1=null, $u2=null, &$error='', User $user=null, $immediate=false) | |
Same as doDeleteArticleReal(), but returns a simple boolean. | |
doDeleteArticleBatched ( $reason, $suppress, User $deleter, $tags, $logsubtype, $immediate=false, $webRequestId=null) | |
Back-end article deletion. | |
doDeleteArticleReal ( $reason, $user=false, $suppress=false, $u2=null, &$error='', User $deleter=null, $tags=[], $logsubtype='delete', $immediate=false) | |
Back-end article deletion Deletes the article with database consistency, writes logs, purges caches. | |
doDeleteUpdates ( $id, Content $content=null, $revRecord=null, User $user=null) | |
Do some database updates after deletion. | |
doEditContent (Content $content, $summary, $flags=0, $originalRevId=false, User $user=null, $serialFormat=null, $tags=[], $undidRevId=0) | |
Change an existing article or create a new article. | |
doEditUpdates ( $revisionRecord, User $user, array $options=[]) | |
Do standard deferred updates after page edit. | |
doPurge () | |
Perform the actions of a page purging. | |
doRollback ( $fromP, $summary, $token, $bot, &$resultDetails, User $user, $tags=null) | |
Roll back the most recent consecutive set of edits to a page from the same user; fails if there are no eligible edits to roll back to, e.g. | |
doSecondaryDataUpdates (array $options=[]) | |
Do secondary data updates (such as updating link tables). | |
doUpdateRestrictions (array $limit, array $expiry, &$cascade, $reason, User $user, $tags=null) | |
Update the article's restriction field, and leave a log entry. | |
doViewUpdates (User $user, $oldid=0) | |
Do standard deferred updates after page view (existing or missing page) | |
exists () | |
followRedirect () | |
Get the Title object or URL this page redirects to. | |
getActionOverrides () | |
getAutoDeleteReason (&$hasHistory) | |
Auto-generates a deletion reason. | |
getCategories () | |
Returns a list of categories this page is a member of. | |
getComment ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
getContent ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
Get the content of the current revision. | |
getContentHandler () | |
Returns the ContentHandler instance to be used to deal with the content of this WikiPage. | |
getContentModel () | |
Returns the page's content model id (see the CONTENT_MODEL_XXX constants). | |
getContributors () | |
Get a list of users who have edited this article, not including the user who made the most recent revision, which you can get from $article->getUser() if you want it. | |
getCreator ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
Get the User object of the user who created the page. | |
getDeletionUpdates ( $rev=null) | |
Returns a list of updates to be performed when this page is deleted. | |
getHiddenCategories () | |
Returns a list of hidden categories this page is a member of. | |
getId () | |
getLatest () | |
Get the page_latest field. | |
getLinksTimestamp () | |
Get the page_links_updated field. | |
getMinorEdit () | |
Returns true if last revision was marked as "minor edit". | |
getMutableCacheKeys (WANObjectCache $cache) | |
getOldestRevision () | |
Get the Revision object of the oldest revision. | |
getParserOutput (ParserOptions $parserOptions, $oldid=null, $forceParse=false) | |
Get a ParserOutput for the given ParserOptions and revision ID. | |
getRedirectTarget () | |
If this page is a redirect, get its target. | |
getRedirectURL ( $rt) | |
Get the Title object or URL to use for a redirect. | |
getRevision () | |
Get the latest revision. | |
getRevisionRecord () | |
Get the latest revision. | |
getSourceURL () | |
Get the source URL for the content on this page, typically the canonical URL, but may be a remote link if the content comes from another site. | |
getTimestamp () | |
getTitle () | |
Get the title object of the article. | |
getTouched () | |
Get the page_touched field. | |
getUndoContent (Revision $undo, Revision $undoafter) | |
Get the content that needs to be saved in order to undo all revisions between $undo and $undoafter. | |
getUser ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
getUserText ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
getWikiDisplayName () | |
The display name for the site this content come from. | |
hasViewableContent () | |
Check if this page is something we're going to be showing some sort of sensible content for. | |
insertNullProtectionRevision (string $revCommentMsg, array $limit, array $expiry, bool $cascade, string $reason, User $user) | |
Insert a new null revision for this page. | |
insertOn ( $dbw, $pageId=null) | |
Insert a new empty page record for this article. | |
insertProtectNullRevision ( $revCommentMsg, array $limit, array $expiry, $cascade, $reason, $user=null) | |
Insert a new null revision for this page. | |
insertRedirect () | |
Insert an entry for this page into the redirect table if the content is a redirect. | |
insertRedirectEntry (Title $rt, $oldLatest=null) | |
Insert or update the redirect table entry for this page to indicate it redirects to $rt. | |
isBatchedDelete ( $safetyMargin=0) | |
Determines if deletion of this page would be batched (executed over time by the job queue) or not (completed in the same request as the delete call). | |
isCountable ( $editInfo=false) | |
Determine whether a page would be suitable for being counted as an article in the site_stats table based on the title & its content. | |
isLocal () | |
Whether this content displayed on this page comes from the local database. | |
isRedirect () | |
Tests if the article content represents a redirect. | |
loadFromRow ( $data, $from) | |
Load the object from a database row. | |
loadPageData ( $from='fromdb') | |
Load the object from a given source by title. | |
lockAndGetLatest () | |
Lock the page row for this title+id and return page_latest (or 0) | |
makeParserOptions ( $context) | |
Get parser options suitable for rendering the primary article wikitext. | |
newPageUpdater (User $user, RevisionSlotsUpdate $forUpdate=null) | |
Returns a PageUpdater for creating new revisions on this page (or creating the page). | |
pageDataFromId ( $dbr, $id, $options=[]) | |
Fetch a page record matching the requested ID. | |
pageDataFromTitle ( $dbr, $title, $options=[]) | |
Fetch a page record matching the Title object's namespace and title using a sanitized title string. | |
prepareContentForEdit (Content $content, $revision=null, User $user=null, $serialFormat=null, $useCache=true) | |
Prepare content which is about to be saved. | |
protectDescription (array $limit, array $expiry) | |
Builds the description to serve as comment for the edit. | |
protectDescriptionLog (array $limit, array $expiry) | |
Builds the description to serve as comment for the log entry. | |
replaceSectionAtRev ( $sectionId, Content $sectionContent, $sectionTitle='', $baseRevId=null) | |
replaceSectionContent ( $sectionId, Content $sectionContent, $sectionTitle='', $edittime=null) | |
setTimestamp ( $ts) | |
Set the page timestamp (use only to avoid DB queries) | |
shouldCheckParserCache (ParserOptions $parserOptions, $oldId) | |
Should the parser cache be used? | |
supportsSections () | |
Returns true if this page's content model supports sections. | |
triggerOpportunisticLinksUpdate (ParserOutput $parserOutput) | |
Opportunistically enqueue link update jobs given fresh parser output if useful. | |
updateCategoryCounts (array $added, array $deleted, $id=0) | |
Update all the appropriate counts in the category table, given that we've added the categories $added and deleted the categories $deleted. | |
updateIfNewerOn ( $dbw, $revision) | |
If the given revision is newer than the currently set page_latest, update the page record. | |
updateParserCache (array $options=[]) | |
Update the parser cache. | |
updateRedirectOn ( $dbw, $redirectTitle, $lastRevIsRedirect=null) | |
Add row to the redirect table if this is a redirect, remove otherwise. | |
updateRevisionOn ( $dbw, $revision, $lastRevision=null, $lastRevIsRedirect=null) | |
Update the page record to point to a newly saved revision. | |
wasLoadedFrom ( $from) | |
Checks whether the page data was loaded using the given database access mode (or better). | |
Static Public Member Functions | |
static | factory (Title $title) |
Create a WikiPage object of the appropriate class for the given title. | |
static | getQueryInfo () |
Return the tables, fields, and join conditions to be selected to create a new page object. | |
static | hasDifferencesOutsideMainSlot ( $a, $b) |
Helper method for checking whether two revisions have differences that go beyond the main slot. | |
static | newFromID ( $id, $from='fromdb') |
Constructor from a page id. | |
static | newFromRow ( $row, $from='fromdb') |
Constructor from a database row. | |
static | onArticleCreate (Title $title) |
The onArticle*() functions are supposed to be a kind of hooks which should be called whenever any of the specified actions are done. | |
static | onArticleDelete (Title $title) |
Clears caches when article is deleted. | |
static | onArticleEdit (Title $title, $revRecord=null, $slotsChanged=null) |
Purge caches on page update etc. | |
Public Attributes | |
bool | $mDataLoaded = false |
bool | $mIsRedirect = false |
int false | $mLatest = false |
False means "not loaded". | |
PreparedEdit false | $mPreparedEdit = false |
Map of cache fields (text, parser output, ect) for a proposed/new edit. | |
Title | $mTitle = null |
Public Attributes inherited from IDBAccessObject | |
const | READ_LOCKING = self::READ_LATEST | 2 |
Constants for object loading bitfield flags (higher => higher QoS) | |
const | READ_NONE = -1 |
Protected Member Functions | |
archiveRevisions ( $dbw, $id, $suppress) | |
Archives revisions as part of page deletion. | |
clearCacheFields () | |
Clear the object cache fields. | |
formatExpiry ( $expiry) | |
loadLastEdit () | |
Loads everything except the text This isn't necessary for all uses, so it's only done if needed. | |
pageData ( $dbr, $conditions, $options=[]) | |
Fetch a page record with the given conditions. | |
Static Protected Member Functions | |
static | convertSelectType ( $type) |
Convert 'fromdb', 'fromdbmaster' and 'forupdate' to READ_* constants. | |
Protected Attributes | |
int | $mDataLoadedFrom = self::READ_NONE |
One of the READ_* constants. | |
int | $mId = null |
string | $mLinksUpdated = '19700101000000' |
Title | $mRedirectTarget = null |
string | $mTimestamp = '' |
Timestamp of the current revision or empty string if not loaded. | |
string | $mTouched = '19700101000000' |
Private Member Functions | |
getContentHandlerFactory () | |
getDBLoadBalancer () | |
getDerivedDataUpdater (User $forUser=null, RevisionRecord $forRevision=null, RevisionSlotsUpdate $forUpdate=null, $forEdit=false) | |
Returns a DerivedPageDataUpdater for use with the given target revision or new content. | |
getParserCache () | |
getRevisionRenderer () | |
getRevisionStore () | |
getSlotRoleRegistry () | |
newDerivedDataUpdater () | |
setLastEdit (RevisionRecord $revRecord) | |
Set the latest revision. | |
Static Private Member Functions | |
static | purgeInterwikiCheckKey (Title $title) |
#- | |
Private Attributes | |
DerivedPageDataUpdater null | $derivedDataUpdater = null |
RevisionRecord | $mLastRevision = null |
Class representing a MediaWiki article and history.
Some fields are public only for backwards-compatibility. Use accessors. In the past, this class was part of Article.php and everything was public.
Definition at line 51 of file WikiPage.php.
WikiPage::__construct | ( | Title | $title | ) |
WikiPage::__clone | ( | ) |
Makes sure that the mTitle object is cloned to the newly cloned WikiPage.
Definition at line 142 of file WikiPage.php.
References $mTitle.
|
protected |
Archives revisions as part of page deletion.
IDatabase | $dbw | |
int | $id | |
bool | $suppress | Suppress all revisions and log the deletion in the suppression log instead of the deletion log |
Definition at line 3011 of file WikiPage.php.
References $res, $revQuery, $wgDeleteRevisionsBatchSize, and getTitle().
WikiPage::checkFlags | ( | $flags | ) |
Check flags and add EDIT_NEW or EDIT_UPDATE to them as needed.
int | $flags |
Definition at line 1723 of file WikiPage.php.
References EDIT_NEW, and EDIT_UPDATE.
WikiPage::checkTouched | ( | ) |
Loads page_touched and returns a value indicating if it should be used.
Definition at line 663 of file WikiPage.php.
WikiPage::clear | ( | ) |
|
protected |
WikiPage::clearPreparedEdit | ( | ) |
Clear the mPreparedEdit cache field, as may be needed by mutable content types.
Definition at line 357 of file WikiPage.php.
WikiPage::commitRollback | ( | $fromP, | |
$summary, | |||
$bot, | |||
& | $resultDetails, | ||
User | $guser, | ||
$tags = null ) |
Backend implementation of doRollback(), please refer there for parameter and return value documentation.
Definition at line 3294 of file WikiPage.php.
References $args, $s, $wgDisableAnonTalk, $wgUseRCPatrol, DB_MASTER, EDIT_FORCE_BOT, EDIT_INTERNAL, EDIT_MINOR, EDIT_UPDATE, wfGetDB(), wfMessage(), wfMsgReplaceArgs(), and wfReadOnly().
|
staticprotected |
Convert 'fromdb', 'fromdbmaster' and 'forupdate' to READ_* constants.
object | string | int | $type |
Definition at line 234 of file WikiPage.php.
References $type.
WikiPage::doDeleteArticle | ( | $reason, | |
$suppress = false, | |||
$u1 = null, | |||
$u2 = null, | |||
& | $error = '', | ||
User | $user = null, | ||
$immediate = false ) |
Same as doDeleteArticleReal(), but returns a simple boolean.
This is kept around for backwards compatibility, if you care about error reporting you should use doDeleteArticleReal() instead.
Deletes the article with database consistency, writes logs, purges caches
string | $reason | Delete reason for deletion log |
bool | $suppress | Suppress all revisions and log the deletion in the suppression log instead of the deletion log |
int | null | $u1 | Unused |
bool | null | $u2 | Unused |
array | string | &$error | Array of errors to append to |
User | null | $user | The deleting user |
bool | $immediate | false allows deleting over time via the job queue |
FatalError | |
MWException |
Definition at line 2750 of file WikiPage.php.
References wfDeprecated().
WikiPage::doDeleteArticleBatched | ( | $reason, | |
$suppress, | |||
User | $deleter, | ||
$tags, | |||
$logsubtype, | |||
$immediate = false, | |||
$webRequestId = null ) |
Back-end article deletion.
Only invokes batching via the job queue if necessary per $wgDeleteRevisionsBatchSize. Deletions can often be completed inline without involving the job queue.
Potentially called many times per deletion operation for pages with many revisions.
string | $reason | |
bool | $suppress | |
User | $deleter | |
array | $tags | |
string | $logsubtype | |
bool | $immediate | |
string | null | $webRequestId |
Definition at line 2839 of file WikiPage.php.
References $content, $job, $mTitle, DB_MASTER, User\getId(), getTitle(), wfDebug(), wfEscapeWikiText(), wfGetDB(), and wfLogWarning().
WikiPage::doDeleteArticleReal | ( | $reason, | |
$user = false, | |||
$suppress = false, | |||
$u2 = null, | |||
& | $error = '', | ||
User | $deleter = null, | ||
$tags = [], | |||
$logsubtype = 'delete', | |||
$immediate = false ) |
Back-end article deletion Deletes the article with database consistency, writes logs, purges caches.
string | $reason | Delete reason for deletion log |
user | bool | $user | The deleting user (not passing a user is deprecated since 1.35) |
bool | null | $suppress | Suppress all revisions and log the deletion in the suppression log instead of the deletion log |
bool | null | $u2 | Unused |
array | string | &$error | Array of errors to append to |
User | null | $deleter | The deleting user in the old signature, unused in the new |
array | $tags | Tags to apply to the deletion action |
string | $logsubtype | |
bool | $immediate | false allows deleting over time via the job queue |
FatalError | |
MWException |
Definition at line 2786 of file WikiPage.php.
References wfDebug(), and wfDeprecated().
Referenced by ApiDelete\delete().
Do some database updates after deletion.
int | $id | The page_id value of the page being deleted |
Content | null | $content | Page content to be used when determining the required updates. This may be needed because $this->getContent() may already return null when the page proper was deleted. |
RevisionRecord | Revision | null | $revRecord | The current page revision at the time of deletion, used when determining the required updates. This may be needed because $this->getRevisionRecord() may already return null when the page proper was deleted. Passing a Revision is deprecated since 1.35 |
User | null | $user | The user that caused the deletion |
Definition at line 3156 of file WikiPage.php.
References $content, User\getName(), NS_FILE, and wfDeprecated().
WikiPage::doEditContent | ( | Content | $content, |
$summary, | |||
$flags = 0, | |||
$originalRevId = false, | |||
User | $user = null, | ||
$serialFormat = null, | |||
$tags = [], | |||
$undidRevId = 0 ) |
Change an existing article or create a new article.
Updates RC and all necessary caches, optionally via the deferred update array.
Content | $content | New content |
string | CommentStoreComment | $summary | Edit summary |
int | $flags | Bitfield: EDIT_NEW Article is known or assumed to be non-existent, create a new one EDIT_UPDATE Article is known or assumed to be pre-existing, update it EDIT_MINOR Mark this edit minor, if the user is allowed to do so EDIT_SUPPRESS_RC Do not log the change in recentchanges EDIT_FORCE_BOT Mark the edit a "bot" edit regardless of user rights EDIT_AUTOSUMMARY Fill in blank summaries with generated text where possible EDIT_INTERNAL Signal that the page retrieve/save cycle happened entirely in this request. |
If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the article will be detected. If EDIT_UPDATE is specified and the article doesn't exist, the function will return an edit-gone-missing error. If EDIT_NEW is specified and the article does exist, an edit-already-exists error will be returned. These two conditions are also possible with auto-detection due to MediaWiki's performance-optimised locking strategy.
bool | int | $originalRevId, | The ID of an original revision that the edit restores or repeats. This is used with reverts and with dummy "null" revisions which are created to record things like page moves. The new revision does not have to have the exact same content as the given original revision, an additional check is made to determine whether these edits really match. In case they don't, $originalRevId is set to false by this method. |
User | null | $user | The user doing the edit |
string | null | $serialFormat | IGNORED. |
array | null | $tags | Change tags to apply to this edit Callers are responsible for permission checks (with ChangeTags::canAddTagsAccompanyingChange) |
int | $undidRevId | Id of the last revision that was undone or 0 |
MWException |
Extensions may define additional errors.
$return->value will contain an associative array with members as follows: new: Boolean indicating if the function attempted to create a new article. revision: The revision object for the inserted revision, or null. Trying to access this Revision object is deprecated since 1.35 revision-record: The RevisionRecord object for the inserted revision, or null.
MWException |
Definition at line 1933 of file WikiPage.php.
References $content, $wgUseNPPatrol, $wgUseRCPatrol, and EDIT_MINOR.
Referenced by ContentModelChange\doContentModelChange().
WikiPage::doEditUpdates | ( | $revisionRecord, | |
User | $user, | ||
array | $options = [] ) |
Do standard deferred updates after page edit.
Update links tables, site stats, search index and message cache. Purges pages that include this page if the text was changed here. Every 100th edit, prune the recent changes table.
Revision | RevisionRecord | $revisionRecord | since 1.35, can be a RevisionRecord object, and passing a Revision is hard deprecated |
User | $user | User object that did the revision |
array | $options | Array of options, following indexes are used:
|
Definition at line 2149 of file WikiPage.php.
References User\getName(), and wfDeprecated().
WikiPage::doPurge | ( | ) |
Perform the actions of a page purging.
Reimplemented in WikiFilePage.
Definition at line 1314 of file WikiPage.php.
References NS_MEDIAWIKI.
WikiPage::doRollback | ( | $fromP, | |
$summary, | |||
$token, | |||
$bot, | |||
& | $resultDetails, | ||
User | $user, | ||
$tags = null ) |
Roll back the most recent consecutive set of edits to a page from the same user; fails if there are no eligible edits to roll back to, e.g.
user is the sole contributor. This function performs permissions checks on $user, then calls commitRollback() to do the dirty work
Definition at line 3245 of file WikiPage.php.
References User\matchEditToken(), User\pingLimiter(), and wfArrayDiff2().
WikiPage::doSecondaryDataUpdates | ( | array | $options = [] | ) |
Do secondary data updates (such as updating link tables).
Secondary data updates are only a small part of the updates needed after saving a new revision; normally PageUpdater::doUpdates should be used instead (which includes secondary data updates). This method is provided for partial purges.
array | $options |
|
Definition at line 2232 of file WikiPage.php.
WikiPage::doUpdateRestrictions | ( | array | $limit, |
array | $expiry, | ||
& | $cascade, | ||
$reason, | |||
User | $user, | ||
$tags = null ) |
Update the article's restriction field, and leave a log entry.
This works for protection both existing and non-existing pages.
array | $limit | Set of restriction keys |
array | $expiry | Per restriction type expiration |
int | &$cascade | Set to false if cascading protection isn't allowed. |
string | $reason | |
User | $user | The user updating the restrictions |
string | string[] | null | $tags | Change tags to add to the pages and protection log entries ($user should be able to add the specified tags before this is called) |
Definition at line 2262 of file WikiPage.php.
References $wgCascadingRestrictionLevels, DB_MASTER, User\getId(), InfoAction\invalidateCache(), wfGetDB(), wfMessage(), wfReadOnly(), and wfReadOnlyReason().
WikiPage::doViewUpdates | ( | User | $user, |
$oldid = 0 ) |
Do standard deferred updates after page view (existing or missing page)
User | $user | The relevant user |
int | $oldid | Revision id being viewed; if not given or 0, latest revision is assumed |
Definition at line 1291 of file WikiPage.php.
References User\clearNotification(), and wfReadOnly().
WikiPage::exists | ( | ) |
Definition at line 588 of file WikiPage.php.
Referenced by LinksDeletionUpdate\__construct().
|
static |
Create a WikiPage object of the appropriate class for the given title.
Title | $title |
MWException |
Definition at line 154 of file WikiPage.php.
References $title, NS_CATEGORY, NS_FILE, and NS_MEDIA.
Referenced by RecentChange\newForCategorization().
WikiPage::followRedirect | ( | ) |
Get the Title object or URL this page redirects to.
Reimplemented in WikiFilePage.
Definition at line 1128 of file WikiPage.php.
|
protected |
string | $expiry | 14-char timestamp or "infinity", or false if the input was invalid |
Definition at line 2629 of file WikiPage.php.
References wfMessage().
WikiPage::getActionOverrides | ( | ) |
Definition at line 296 of file WikiPage.php.
WikiPage::getAutoDeleteReason | ( | & | $hasHistory | ) |
Auto-generates a deletion reason.
bool | &$hasHistory | Whether the page has a history |
Definition at line 3815 of file WikiPage.php.
References getTitle().
Referenced by ApiDelete\delete().
WikiPage::getCategories | ( | ) |
Returns a list of categories this page is a member of.
Results will include hidden categories
Definition at line 3761 of file WikiPage.php.
References $dbr, $res, DB_REPLICA, NS_CATEGORY, and wfGetDB().
WikiPage::getComment | ( | $audience = RevisionRecord::FOR_PUBLIC, | |
User | $user = null ) |
int | $audience | One of: RevisionRecord::FOR_PUBLIC to be displayed to all users RevisionRecord::FOR_THIS_USER to be displayed to the given user RevisionRecord::RAW get the text regardless of permissions |
User | null | $user | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter (not passing for FOR_THIS_USER is deprecated since 1.35) |
Definition at line 922 of file WikiPage.php.
References wfDeprecated().
WikiPage::getContent | ( | $audience = RevisionRecord::FOR_PUBLIC, | |
User | $user = null ) |
Get the content of the current revision.
No side-effects...
int | $audience | One of: RevisionRecord::FOR_PUBLIC to be displayed to all users RevisionRecord::FOR_THIS_USER to be displayed to $wgUser RevisionRecord::RAW get the text regardless of permissions |
User | null | $user | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 802 of file WikiPage.php.
Referenced by ContentHandler\getDataForSearchIndex(), TextContentHandler\getDataForSearchIndex(), ApiParse\getParsedContent(), and EditPage\getPreloadedContent().
WikiPage::getContentHandler | ( | ) |
Returns the ContentHandler instance to be used to deal with the content of this WikiPage.
Shorthand for ContentHandler::getForModelID( $this->getContentModel() );
Definition at line 309 of file WikiPage.php.
|
private |
Definition at line 272 of file WikiPage.php.
References getContentHandlerFactory().
Referenced by getContentHandlerFactory().
WikiPage::getContentModel | ( | ) |
Returns the page's content model id (see the CONTENT_MODEL_XXX constants).
Will use the revisions actual content model if the page exists, and the page's default if the page doesn't exist yet.
Definition at line 630 of file WikiPage.php.
References $cache, $title, and wfWarn().
Referenced by ParserCache\incrementStats().
WikiPage::getContributors | ( | ) |
Get a list of users who have edited this article, not including the user who made the most recent revision, which you can get from $article->getUser() if you want it.
Definition at line 1177 of file WikiPage.php.
References $dbr, $res, DB_REPLICA, getUser(), and wfGetDB().
WikiPage::getCreator | ( | $audience = RevisionRecord::FOR_PUBLIC, | |
User | $user = null ) |
Get the User object of the user who created the page.
int | $audience | One of: RevisionRecord::FOR_PUBLIC to be displayed to all users RevisionRecord::FOR_THIS_USER to be displayed to the given user RevisionRecord::RAW get the text regardless of permissions |
User | null | $user | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter (not passing for FOR_THIS_USER is deprecated since 1.35) |
Definition at line 868 of file WikiPage.php.
References getTitle(), and wfDeprecated().
|
private |
Definition at line 286 of file WikiPage.php.
WikiPage::getDeletionUpdates | ( | $rev = null | ) |
Returns a list of updates to be performed when this page is deleted.
The updates should remove any information about this page from secondary data stores such as links tables.
RevisionRecord | Content | null | $rev | The revision being deleted. Also accepts a Content object for backwards compatibility. |
Definition at line 3968 of file WikiPage.php.
References $content, MediaWiki\Revision\SlotRecord\getContent(), getTitle(), wfDebug(), and wfDeprecated().
|
private |
Returns a DerivedPageDataUpdater for use with the given target revision or new content.
This method attempts to re-use the same DerivedPageDataUpdater instance for subsequent calls. The parameters passed to this method are used to ensure that the DerivedPageDataUpdater returned matches that caller's expectations, allowing an existing instance to be re-used if the given parameters match that instance's internal state according to DerivedPageDataUpdater::isReusableFor(), and creating a new instance of the parameters do not match the existign one.
If neither $forRevision nor $forUpdate is given, a new DerivedPageDataUpdater is always created, replacing any DerivedPageDataUpdater currently cached.
MCR migration note: this replaces WikiPage::prepareContentForEdit.
User | null | $forUser | The user that will be used for, or was used for, PST. |
RevisionRecord | null | $forRevision | The revision created by the edit for which to perform updates, if the edit was already saved. |
RevisionSlotsUpdate | null | $forUpdate | The new content to be saved by the edit (pre PST), if the edit was not yet saved. |
bool | $forEdit | Only re-use if the cached DerivedPageDataUpdater has the current revision as the edit's parent revision. This ensures that the same DerivedPageDataUpdater cannot be re-used for two consecutive edits. |
Definition at line 1790 of file WikiPage.php.
WikiPage::getHiddenCategories | ( | ) |
Returns a list of hidden categories this page is a member of.
Uses the page_props and categorylinks tables.
Definition at line 3784 of file WikiPage.php.
References $dbr, $res, DB_REPLICA, NS_CATEGORY, and wfGetDB().
WikiPage::getId | ( | ) |
Definition at line 578 of file WikiPage.php.
Referenced by LinksDeletionUpdate\__construct(), PoolWorkArticleView\__construct(), MediaWiki\Storage\DerivedPageDataUpdater\doParserCacheUpdate(), RefreshLinksJob\getCurrentRevisionIfUnchanged(), ParserCache\getOptionsKey(), ApiParse\getParsedContent(), and ParserCache\getParserOutputKey().
WikiPage::getLatest | ( | ) |
Get the page_latest field.
Definition at line 696 of file WikiPage.php.
Referenced by ParserCache\getKey(), ApiParse\getParsedContent(), and InfoAction\pageCounts().
WikiPage::getLinksTimestamp | ( | ) |
Get the page_links_updated field.
Definition at line 685 of file WikiPage.php.
Referenced by RefreshLinksJob\isAlreadyRefreshed().
WikiPage::getMinorEdit | ( | ) |
Returns true if last revision was marked as "minor edit".
Definition at line 945 of file WikiPage.php.
WikiPage::getMutableCacheKeys | ( | WANObjectCache | $cache | ) |
WANObjectCache | $cache |
Definition at line 4071 of file WikiPage.php.
References $cache, and getTitle().
WikiPage::getOldestRevision | ( | ) |
Get the Revision object of the oldest revision.
Definition at line 709 of file WikiPage.php.
References getTitle(), and wfDeprecated().
|
private |
Definition at line 279 of file WikiPage.php.
WikiPage::getParserOutput | ( | ParserOptions | $parserOptions, |
$oldid = null, | |||
$forceParse = false ) |
Get a ParserOutput for the given ParserOptions and revision ID.
The parser cache will be used if possible. Cache misses that result in parser runs are debounced with PoolCounter.
XXX merge this with updateParserCache()?
ParserOptions | $parserOptions | ParserOptions to use for the parse operation |
null | int | $oldid | Revision ID to get the text from, passing null or 0 will get the current revision (default value) |
bool | $forceParse | Force reindexing, regardless of cache settings |
Definition at line 1249 of file WikiPage.php.
References ParserOptions\getStubThreshold(), ParserOptions\isSafeToCache(), and wfDebug().
Referenced by ApiParse\getPageParserOutput(), and DifferenceEngine\getParserOutput().
|
static |
Return the tables, fields, and join conditions to be selected to create a new page object.
$table
to IDatabase->select()
$vars
to IDatabase->select()
$join_conds
to IDatabase->select()
Definition at line 370 of file WikiPage.php.
References $wgPageLanguageUseDB.
WikiPage::getRedirectTarget | ( | ) |
If this page is a redirect, get its target.
The target will be fetched from the redirect table if possible. If this page doesn't have an entry there, call insertRedirect()
Reimplemented in WikiFilePage.
Definition at line 1015 of file WikiPage.php.
References $dbr, DB_REPLICA, NS_FILE, NS_MEDIA, and wfGetDB().
Referenced by EditPage\getPreloadedContent().
WikiPage::getRedirectURL | ( | $rt | ) |
Get the Title object or URL to use for a redirect.
We use Title objects for same-wiki, non-special redirects and URLs for everything else.
Title | $rt | Redirect target |
Definition at line 1139 of file WikiPage.php.
References $source.
WikiPage::getRevision | ( | ) |
Get the latest revision.
Definition at line 768 of file WikiPage.php.
References wfDeprecated().
WikiPage::getRevisionRecord | ( | ) |
Get the latest revision.
Definition at line 781 of file WikiPage.php.
Referenced by PoolWorkArticleView\__construct(), RefreshLinksJob\getCurrentRevisionIfUnchanged(), MediaWiki\Storage\DerivedPageDataUpdater\grabCurrentRevision(), ContentHandler\latestRevision(), and ParserCache\save().
|
private |
Definition at line 258 of file WikiPage.php.
|
private |
Definition at line 251 of file WikiPage.php.
|
private |
Definition at line 265 of file WikiPage.php.
WikiPage::getSourceURL | ( | ) |
Get the source URL for the content on this page, typically the canonical URL, but may be a remote link if the content comes from another site.
Reimplemented in WikiFilePage.
Definition at line 4062 of file WikiPage.php.
References getTitle().
WikiPage::getTimestamp | ( | ) |
Definition at line 813 of file WikiPage.php.
Referenced by CreditsAction\getAuthor(), InfoAction\pageCounts(), and ParserCache\save().
WikiPage::getTitle | ( | ) |
Get the title object of the article.
Definition at line 318 of file WikiPage.php.
References $mTitle.
Referenced by LinksDeletionUpdate\__construct(), PoolWorkArticleView\__construct(), ApiDelete\delete(), ApiDelete\deleteFile(), ContentModelChange\doContentModelChange(), RefreshLinksJob\getCurrentRevisionIfUnchanged(), TextContentHandler\getDataForSearchIndex(), FileContentHandler\getDataForSearchIndex(), WikitextContentHandler\getDataForSearchIndex(), ParserCache\getETag(), ParserCache\getKey(), ApiParse\getParsedContent(), WikiCategoryPage\isExpectedUnusedCategory(), WikiCategoryPage\isHidden(), ContentHandler\latestRevision(), ApiParse\makeParserOptions(), Article\newFromWikiPage(), CategoryMembershipChangeJob\notifyUpdatesForRevision(), InfoAction\pageCounts(), MediaWiki\Storage\PageEditStash\parseAndCache(), ParserCache\save(), and RequestContext\setWikiPage().
WikiPage::getTouched | ( | ) |
Get the page_touched field.
Definition at line 674 of file WikiPage.php.
Referenced by ParserCache\getETag(), ParserCache\getKey(), and RefreshLinksJob\getParserOutputFromCache().
Get the content that needs to be saved in order to undo all revisions between $undo and $undoafter.
Revisions must belong to the same page, must exist and must not be deleted
Definition at line 1591 of file WikiPage.php.
References Revision\getContentHandler(), Revision\getRevisionRecord(), and wfDeprecated().
WikiPage::getUser | ( | $audience = RevisionRecord::FOR_PUBLIC, | |
User | $user = null ) |
int | $audience | One of: RevisionRecord::FOR_PUBLIC to be displayed to all users RevisionRecord::FOR_THIS_USER to be displayed to the given user RevisionRecord::RAW get the text regardless of permissions |
User | null | $user | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter (not passing for FOR_THIS_USER is deprecated since 1.35) |
Definition at line 840 of file WikiPage.php.
References wfDeprecated().
WikiPage::getUserText | ( | $audience = RevisionRecord::FOR_PUBLIC, | |
User | $user = null ) |
int | $audience | One of: RevisionRecord::FOR_PUBLIC to be displayed to all users RevisionRecord::FOR_THIS_USER to be displayed to the given user RevisionRecord::RAW get the text regardless of permissions |
User | null | $user | User object to check for, only if FOR_THIS_USER is passed to the $audience parameter (not passing for FOR_THIS_USER is deprecated since 1.35) |
Definition at line 894 of file WikiPage.php.
References wfDeprecated().
Referenced by CreditsAction\getAuthor().
WikiPage::getWikiDisplayName | ( | ) |
The display name for the site this content come from.
If a subclass overrides isLocal(), this could return something other than the current site name
Reimplemented in WikiFilePage.
Definition at line 4049 of file WikiPage.php.
References $wgSitename.
|
static |
Helper method for checking whether two revisions have differences that go beyond the main slot.
MCR migration note: this method should go away!
Revision | RevisionRecord | $a | (revision deprecated since 1.35) |
Revision | RevisionRecord | $b | (revision deprecated since 1.35) |
Definition at line 1562 of file WikiPage.php.
References wfDeprecated().
WikiPage::hasViewableContent | ( | ) |
Check if this page is something we're going to be showing some sort of sensible content for.
If we return false, page views (plain action=view) will return an HTTP 404 response, so spiders and robots can know they're following a bad link.
Reimplemented in WikiCategoryPage.
Definition at line 603 of file WikiPage.php.
WikiPage::insertNullProtectionRevision | ( | string | $revCommentMsg, |
array | $limit, | ||
array | $expiry, | ||
bool | $cascade, | ||
string | $reason, | ||
User | $user ) |
Insert a new null revision for this page.
string | $revCommentMsg | Comment message key for the revision |
array | $limit | Set of restriction keys |
array | $expiry | Per restriction type expiration |
bool | $cascade | Set to false if cascading protection isn't allowed. |
string | $reason | |
User | $user | User to attribute to |
Definition at line 2569 of file WikiPage.php.
References wfMessage().
WikiPage::insertOn | ( | $dbw, | |
$pageId = null ) |
Insert a new empty page record for this article.
This must be followed up by creating a revision and running $this->updateRevisionOn( ... ); or else the record will be left in a funky state. Best if all done inside a transaction.
IDatabase | $dbw | |
int | null | $pageId | Custom page ID that will be used for the insert statement |
Definition at line 1349 of file WikiPage.php.
References wfRandom().
Referenced by MediaWiki\Storage\PageUpdater\doCreate().
WikiPage::insertProtectNullRevision | ( | $revCommentMsg, | |
array | $limit, | ||
array | $expiry, | ||
$cascade, | |||
$reason, | |||
$user = null ) |
Insert a new null revision for this page.
string | $revCommentMsg | Comment message key for the revision |
array | $limit | Set of restriction keys |
array | $expiry | Per restriction type expiration |
int | $cascade | Set to false if cascading protection isn't allowed. |
string | $reason | |
User | null | $user | User to attribute to, or null for $wgUser (deprecated since 1.35) |
Definition at line 2538 of file WikiPage.php.
References wfDeprecated().
WikiPage::insertRedirect | ( | ) |
Insert an entry for this page into the redirect table if the content is a redirect.
The database update will be deferred via DeferredUpdates
Don't call this function directly unless you know what you're doing.
Definition at line 1062 of file WikiPage.php.
WikiPage::insertRedirectEntry | ( | Title | $rt, |
$oldLatest = null ) |
Insert or update the redirect table entry for this page to indicate it redirects to $rt.
Title | $rt | Redirect target |
int | null | $oldLatest | Prior page_latest for check and set |
Definition at line 1088 of file WikiPage.php.
References $success, DB_MASTER, Title\getDBkey(), Title\getFragment(), Title\getInterwiki(), Title\getNamespace(), and wfGetDB().
WikiPage::isBatchedDelete | ( | $safetyMargin = 0 | ) |
Determines if deletion of this page would be batched (executed over time by the job queue) or not (completed in the same request as the delete call).
It is unlikely but possible that an edit from another request could push the page over the batching threshold after this function is called, but before the caller acts upon the return value. Callers must decide for themselves how to deal with this. $safetyMargin is provided as an unreliable but situationally useful help for some common cases.
int | $safetyMargin | Added to the revision count when checking for batching |
Definition at line 2719 of file WikiPage.php.
References $dbr, $wgDeleteRevisionsBatchSize, DB_REPLICA, and wfGetDB().
WikiPage::isCountable | ( | $editInfo = false | ) |
Determine whether a page would be suitable for being counted as an article in the site_stats table based on the title & its content.
PreparedEdit | bool | $editInfo | (false): object returned by prepareTextForEdit(), if false, the current database state will be used |
Definition at line 962 of file WikiPage.php.
References $content, $wgArticleCountMethod, DB_REPLICA, and wfGetDB().
Referenced by MediaWiki\Storage\DerivedPageDataUpdater\grabCurrentRevision().
WikiPage::isLocal | ( | ) |
Whether this content displayed on this page comes from the local database.
Reimplemented in WikiFilePage.
Definition at line 4036 of file WikiPage.php.
WikiPage::isRedirect | ( | ) |
Tests if the article content represents a redirect.
Reimplemented in WikiFilePage.
Definition at line 612 of file WikiPage.php.
Referenced by EditPage\getPreloadedContent(), and MediaWiki\Storage\DerivedPageDataUpdater\grabCurrentRevision().
WikiPage::loadFromRow | ( | $data, | |
$from ) |
Load the object from a database row.
object | bool | $data | DB row containing fields returned by getQueryInfo() or false |
string | int | $from | One of the following:
|
Definition at line 536 of file WikiPage.php.
|
protected |
Loads everything except the text This isn't necessary for all uses, so it's only done if needed.
Definition at line 719 of file WikiPage.php.
References getTitle().
WikiPage::loadPageData | ( | $from = 'fromdb' | ) |
Load the object from a given source by title.
object | string | int | $from | One of the following:
|
Definition at line 465 of file WikiPage.php.
References DB_REPLICA.
Referenced by MediaWiki\Storage\DerivedPageDataUpdater\grabCurrentRevision(), and ContentHandler\latestRevision().
WikiPage::lockAndGetLatest | ( | ) |
Lock the page row for this title+id and return page_latest (or 0)
Definition at line 3127 of file WikiPage.php.
References DB_MASTER, getTitle(), and wfGetDB().
Referenced by MediaWiki\Storage\PageUpdater\doModify().
WikiPage::makeParserOptions | ( | $context | ) |
Get parser options suitable for rendering the primary article wikitext.
IContextSource | User | string | $context | One of the following:
|
Definition at line 2046 of file WikiPage.php.
References getTitle().
Referenced by CategoryMembershipChangeJob\getCategoriesAtRev(), RefreshLinksJob\getParserOutput(), DifferenceEngine\getParserOutput(), ContentHandler\getParserOutputForIndexing(), RefreshLinksJob\getParserOutputFromCache(), and ApiParse\makeParserOptions().
|
private |
Definition at line 1738 of file WikiPage.php.
References $wgArticleCountMethod, and $wgRCWatchCategoryMembership.
|
static |
Constructor from a page id.
int | $id | Article ID to load |
string | int | $from | One of the following values:
|
Definition at line 192 of file WikiPage.php.
References DB_MASTER, DB_REPLICA, and wfGetDB().
|
static |
Constructor from a database row.
object | $row | Database row containing at least fields returned by getQueryInfo(). |
string | int | $from | Source of $data:
|
Definition at line 222 of file WikiPage.php.
WikiPage::newPageUpdater | ( | User | $user, |
RevisionSlotsUpdate | $forUpdate = null ) |
Returns a PageUpdater for creating new revisions on this page (or creating the page).
The PageUpdater can also be used to detect the need for edit conflict resolution, and to protected such conflict resolution from concurrent edits using a check-and-set mechanism.
User | $user | |
RevisionSlotsUpdate | null | $forUpdate | If given, allows any cached ParserOutput that may already have been returned via getDerivedDataUpdater to be re-used. |
Definition at line 1846 of file WikiPage.php.
References $wgAjaxEditStash, $wgPageCreationLog, and $wgUseAutomaticEditSummaries.
|
static |
The onArticle*() functions are supposed to be a kind of hooks which should be called whenever any of the specified actions are done.
This is a good place to put code to clear caches, for instance.
This is called on page move and undelete, as well as edit
Title | $title |
Definition at line 3587 of file WikiPage.php.
References $job, $title, HTMLCacheUpdateJob\newForBacklinks(), and NS_CATEGORY.
|
static |
Clears caches when article is deleted.
Title | $title |
Definition at line 3623 of file WikiPage.php.
References $job, $title, InfoAction\invalidateCache(), HTMLCacheUpdateJob\newForBacklinks(), NS_FILE, NS_MEDIAWIKI, and NS_USER_TALK.
|
static |
Purge caches on page update etc.
Title | $title | |
RevisionRecord | Revision | null | $revRecord | Revision that was just saved, may be null passing a Revision is hard deprecated since 1.35 |
string[] | null | $slotsChanged | The role names of the slots that were changed. If not given, all slots are assumed to have changed. |
Definition at line 3680 of file WikiPage.php.
References $title, InfoAction\invalidateCache(), HTMLCacheUpdateJob\newForBacklinks(), and wfDeprecated().
|
protected |
Fetch a page record with the given conditions.
IDatabase | $dbr | |
array | $conditions | |
array | $options |
Definition at line 406 of file WikiPage.php.
References $dbr.
WikiPage::pageDataFromId | ( | $dbr, | |
$id, | |||
$options = [] ) |
Fetch a page record matching the requested ID.
IDatabase | $dbr | |
int | $id | |
array | $options |
Definition at line 449 of file WikiPage.php.
References $dbr.
WikiPage::pageDataFromTitle | ( | $dbr, | |
$title, | |||
$options = [] ) |
WikiPage::prepareContentForEdit | ( | Content | $content, |
$revision = null, | |||
User | $user = null, | ||
$serialFormat = null, | |||
$useCache = true ) |
Prepare content which is about to be saved.
Prior to 1.30, this returned a stdClass.
Content | $content | |
Revision | RevisionRecord | null | $revision | Revision object. Used with vary-revision or vary-revision-id. Passing a Revision object is hard deprecated since 1.35; |
User | null | $user | |
string | null | $serialFormat | IGNORED |
bool | $useCache | Check shared prepared edit cache |
Definition at line 2077 of file WikiPage.php.
References $content, and wfDeprecated().
Referenced by MediaWiki\Storage\PageEditStash\parseAndCache().
WikiPage::protectDescription | ( | array | $limit, |
array | $expiry ) |
Builds the description to serve as comment for the edit.
array | $limit | Set of restriction keys |
array | $expiry | Per restriction type expiration |
Definition at line 2651 of file WikiPage.php.
References wfMessage().
WikiPage::protectDescriptionLog | ( | array | $limit, |
array | $expiry ) |
Builds the description to serve as comment for the log entry.
Some bots may parse IRC lines, which are generated from log entries which contain plain protect description text. Keep them in old format to avoid breaking compatibility. TODO: Fix protection log to store structured description and format it on-the-fly.
array | $limit | Set of restriction keys |
array | $expiry | Per restriction type expiration |
Definition at line 2693 of file WikiPage.php.
|
staticprivate |
#-
Purge the check key for cross-wiki cache entries referencing this page
Title | $title |
Definition at line 3733 of file WikiPage.php.
References $cache, $title, and $wgEnableScaryTranscluding.
WikiPage::replaceSectionAtRev | ( | $sectionId, | |
Content | $sectionContent, | ||
$sectionTitle = '', | |||
$baseRevId = null ) |
string | int | null | bool | $sectionId | Section identifier as a number or string (e.g. 0, 1 or 'T-1'), null/false or an empty string for the whole page or 'new' for a new section. |
Content | $sectionContent | New content of the section. |
string | $sectionTitle | New section's subject, only if $section is "new". |
int | null | $baseRevId |
MWException |
Definition at line 1677 of file WikiPage.php.
References wfDebug().
WikiPage::replaceSectionContent | ( | $sectionId, | |
Content | $sectionContent, | ||
$sectionTitle = '', | |||
$edittime = null ) |
string | int | null | bool | $sectionId | Section identifier as a number or string (e.g. 0, 1 or 'T-1'), null/false or an empty string for the whole page or 'new' for a new section. |
Content | $sectionContent | New content of the section. |
string | $sectionTitle | New section's subject, only if $section is "new". |
string | $edittime | Revision timestamp or null to use the current revision. |
MWException |
Definition at line 1639 of file WikiPage.php.
|
private |
Set the latest revision.
RevisionRecord | $revRecord |
Definition at line 758 of file WikiPage.php.
References MediaWiki\Revision\RevisionRecord\getTimestamp().
WikiPage::setTimestamp | ( | $ts | ) |
Set the page timestamp (use only to avoid DB queries)
string | $ts | MW timestamp of last article revision |
Definition at line 827 of file WikiPage.php.
WikiPage::shouldCheckParserCache | ( | ParserOptions | $parserOptions, |
$oldId ) |
Should the parser cache be used?
ParserOptions | $parserOptions | ParserOptions to check |
int | $oldId |
Definition at line 1227 of file WikiPage.php.
References ParserOptions\getStubThreshold().
WikiPage::supportsSections | ( | ) |
Returns true if this page's content model supports sections.
The skin should check this and not offer section functionality if sections are not supported.
The EditPage should check this and not offer section functionality if sections are not supported.
Definition at line 1621 of file WikiPage.php.
WikiPage::triggerOpportunisticLinksUpdate | ( | ParserOutput | $parserOutput | ) |
Opportunistically enqueue link update jobs given fresh parser output if useful.
ParserOutput | $parserOutput | Current version page output |
Definition at line 3914 of file WikiPage.php.
References $cache, CacheTime\getCacheExpiry(), CacheTime\getCacheTime(), ParserOutput\hasDynamicContent(), RefreshLinksJob\newDynamic(), RefreshLinksJob\newPrioritized(), and wfReadOnly().
WikiPage::updateCategoryCounts | ( | array | $added, |
array | $deleted, | ||
$id = 0 ) |
Update all the appropriate counts in the category table, given that we've added the categories $added and deleted the categories $deleted.
This should only be called from deferred updates or jobs to avoid contention.
string[] | $added | The names of categories that were added |
string[] | $deleted | The names of categories that were deleted |
int | $id | Page ID (this should be the original deleted page ID) |
Definition at line 3829 of file WikiPage.php.
References $type, DB_MASTER, getTitle(), and wfGetDB().
WikiPage::updateIfNewerOn | ( | $dbw, | |
$revision ) |
If the given revision is newer than the currently set page_latest, update the page record.
Otherwise, do nothing.
IDatabase | $dbw | |
Revision | $revision |
Definition at line 1512 of file WikiPage.php.
References wfDeprecated().
WikiPage::updateParserCache | ( | array | $options = [] | ) |
Update the parser cache.
array | $options |
|
Definition at line 2188 of file WikiPage.php.
WikiPage::updateRedirectOn | ( | $dbw, | |
$redirectTitle, | |||
$lastRevIsRedirect = null ) |
Add row to the redirect table if this is a redirect, remove otherwise.
IDatabase | $dbw | |
Title | null | $redirectTitle | Title object pointing to the redirect target, or NULL if this is not a redirect |
null | bool | $lastRevIsRedirect | If given, will optimize adding and removing rows in redirect table. |
Definition at line 1475 of file WikiPage.php.
References $success, getTitle(), and NS_FILE.
WikiPage::updateRevisionOn | ( | $dbw, | |
$revision, | |||
$lastRevision = null, | |||
$lastRevIsRedirect = null ) |
Update the page record to point to a newly saved revision.
IDatabase | $dbw | |
Revision | RevisionRecord | $revision | For ID number, and text used to set length and redirect status fields. Passing a Revision is deprecated since 1.35 |
int | null | $lastRevision | If given, will not overwrite the page field when different from the currently set value. Giving 0 indicates the new page flag should be set on. |
bool | null | $lastRevIsRedirect | If given, will optimize adding and removing rows in redirect table. |
Definition at line 1394 of file WikiPage.php.
References $content, and wfDeprecated().
Referenced by MediaWiki\Storage\PageUpdater\doCreate(), and MediaWiki\Storage\PageUpdater\doModify().
WikiPage::wasLoadedFrom | ( | $from | ) |
Checks whether the page data was loaded using the given database access mode (or better).
string | int | $from | One of the following:
|
Definition at line 510 of file WikiPage.php.
|
private |
Definition at line 129 of file WikiPage.php.
bool WikiPage::$mDataLoaded = false |
|
protected |
One of the READ_* constants.
Definition at line 99 of file WikiPage.php.
|
protected |
Definition at line 94 of file WikiPage.php.
bool WikiPage::$mIsRedirect = false |
|
private |
Definition at line 109 of file WikiPage.php.
int false WikiPage::$mLatest = false |
False means "not loaded".
Definition at line 82 of file WikiPage.php.
|
protected |
Definition at line 124 of file WikiPage.php.
PreparedEdit false WikiPage::$mPreparedEdit = false |
Map of cache fields (text, parser output, ect) for a proposed/new edit.
Definition at line 89 of file WikiPage.php.
|
protected |
Definition at line 104 of file WikiPage.php.
|
protected |
Timestamp of the current revision or empty string if not loaded.
Definition at line 114 of file WikiPage.php.
Title WikiPage::$mTitle = null |
|
protected |
Definition at line 119 of file WikiPage.php.