Inherited by CategoryPage, and ImagePage.
Public Member Functions | |
__construct (Title $title, $oldId=null) | |
Constructor and clear the article. | |
setRedirectedFrom ($from) | |
Tell the page view functions that this view was redirected from another page on the wiki. | |
getRedirectTarget () | |
If this page is a redirect, get its target. | |
insertRedirect () | |
Insert an entry for this page into the redirect table. | |
followRedirect () | |
Get the Title object this page redirects to. | |
followRedirectText ($text) | |
Get the Title object this text redirects to. | |
getTitle () | |
get the title object of the article | |
clear () | |
Clear the object. | |
getContent () | |
Note that getContent/loadContent do not follow redirects anymore. | |
getRawText () | |
Get the text of the current revision. | |
getSection ($text, $section) | |
This function returns the text of a section, specified by a number ($section). | |
getUndoText (Revision $undo, Revision $undoafter=null) | |
Get the text that needs to be saved in order to undo all revisions between $undo and $undoafter. | |
getOldID () | |
getOldIDFromRequest () | |
Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect. | |
loadContent () | |
Load the revision (including text) into this object. | |
pageDataFromTitle ($dbr, $title) | |
loadPageData ($data= 'fromdb') | |
Set the general counter, title etc data loaded from some source. | |
fetchContent ($oldid=0) | |
Get text of an article from database Does *NOT* follow redirects. | |
forUpdate ($x=NULL) | |
Read/write accessor to select FOR UPDATE. | |
getDB () | |
Get the database which should be used for reads. | |
getID () | |
exists () | |
hasViewableContent () | |
Check if this page is something we're going to be showing some sort of sensible content for. | |
getCount () | |
isCountable ($text) | |
Determine whether a page would be suitable for being counted as an article in the site_stats table based on the title & its content. | |
isRedirect ($text=false) | |
Tests if the article text represents a redirect. | |
isCurrent () | |
Returns true if the currently-referenced revision is the current edit to this page (and it exists). | |
getTimestamp () | |
getUser () | |
getUserText () | |
getComment () | |
getMinorEdit () | |
getRevIdFetched () | |
getContributors ($limit=0, $offset=0) | |
view () | |
This is the default action of the script: just view the page of the given title. | |
viewRedirect ($target, $appendSubtitle=true, $forceKnown=false) | |
View redirect. | |
addTrackbacks () | |
deletetrackback () | |
render () | |
purge () | |
Handle action=purge. | |
doPurge () | |
Perform the actions of a page purging. | |
insertOn ($dbw) | |
Insert a new empty page record for this article. | |
updateRevisionOn (&$dbw, $revision, $lastRevision=null, $lastRevIsRedirect=null) | |
Update the page record to point to a newly saved revision. | |
updateRedirectOn (&$dbw, $redirectTitle, $lastRevIsRedirect=null) | |
Add row to the redirect table if this is a redirect, remove otherwise. | |
updateIfNewerOn (&$dbw, $revision) | |
If the given revision is newer than the currently set page_latest, update the page record. | |
replaceSection ($section, $text, $summary= '', $edittime=NULL) | |
insertNewArticle ($text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false, $bot=false) | |
updateArticle ($text, $summary, $minor, $watchthis, $forceBot=false, $sectionanchor= '') | |
doEdit ($text, $summary, $flags=0, $baseRevId=false, $user=null) | |
Article::doEdit(). | |
showArticle ($text, $subtitle, $sectionanchor= '', $me2, $now, $summary, $oldid) | |
doRedirect ($noRedir=false, $sectionAnchor= '', $extraQuery= '') | |
Output a redirect back to the article. | |
markpatrolled () | |
Mark this particular edit/page as patrolled. | |
watch () | |
User-interface handler for the "watch" action. | |
doWatch () | |
Add this page to $wgUser's watchlist. | |
unwatch () | |
User interface handler for the "unwatch" action. | |
doUnwatch () | |
Stop watching a page. | |
protect () | |
action=protect handler | |
unprotect () | |
action=unprotect handler (alias) | |
updateRestrictions ($limit=array(), $reason= '', &$cascade=0, $expiry=array()) | |
Update the article's restriction field, and leave a log entry. | |
generateReason (&$hasHistory) | |
Auto-generates a deletion reason. | |
delete () | |
isBigDeletion () | |
estimateRevisionCount () | |
getLastNAuthors ($num, $revLatest=0) | |
Get the last N authors. | |
confirmDelete ($reason) | |
Output deletion confirmation dialog. | |
doDelete ($reason, $suppress=false) | |
Perform a deletion and output success or failure messages. | |
doDeleteArticle ($reason, $suppress=false, $id=0) | |
Back-end article deletion Deletes the article with database consistency, writes logs, purges caches Returns success. | |
doRollback ($fromP, $summary, $token, $bot, &$resultDetails) | |
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. | |
commitRollback ($fromP, $summary, $bot, &$resultDetails) | |
Backend implementation of doRollback(), please refer there for parameter and return value documentation. | |
rollback () | |
User interface for rollback operations. | |
viewUpdates () | |
Do standard deferred updates after page view. | |
prepareTextForEdit ($text, $revid=null) | |
Prepare text which is about to be saved. | |
editUpdates ($text, $summary, $minoredit, $timestamp_of_pagechange, $newid, $changed=true) | |
Do standard deferred updates after page edit. | |
createUpdates ($rev) | |
Perform article updates on a special page creation. | |
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 ->. | |
preSaveTransform ($text) | |
This function is called right before saving the wikitext, so we can do things like signatures and links-in-context. | |
isFileCacheable () | |
Check if the page can be cached. | |
checkTouched () | |
Loads page_touched and returns a value indicating if it should be used. | |
getTouched () | |
Get the page_touched field. | |
getLatest () | |
Get the page_latest field. | |
quickEdit ($text, $comment= '', $minor=0) | |
Edit an article without doing all that other stuff The article must already exist; link tables etc are not updated, caches are not flushed. | |
revert () | |
#@- | |
info () | |
Info about this page Called for ?action=info when $wgAllowPageInfo is on. | |
getUsedTemplates () | |
Return a list of templates used by this article. | |
getHiddenCategories () | |
Returns a list of hidden categories this page is a member of. | |
outputWikiText ($text, $cache=true) | |
Add the primary page-view wikitext to the output buffer Saves the text into the parser cache if possible. | |
updateCategoryCounts ($added, $deleted) | |
Update all the appropriate counts in the category table, given that we've added the categories $added and deleted the categories $deleted. | |
Static Public Member Functions | |
static | newFromID ($id) |
Constructor from an article article. | |
static | incViewCount ($id) |
Used to increment the view counter. | |
static | onArticleCreate ($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) |
static | onArticleEdit ($title, $flags= '') |
Purge caches on page update etc. | |
static | getAutosummary ($oldtext, $newtext, $flags) |
Return an applicable autosummary if one exists for the given edit. | |
Public Attributes | |
$mComment = '' | |
$mContent | |
$mContentLoaded = false | |
$mCounter = -1 | |
Not loaded. | |
$mCurID = -1 | |
Not loaded. | |
$mDataLoaded = false | |
$mForUpdate = false | |
$mGoodAdjustment = 0 | |
$mIsRedirect = false | |
$mLatest = false | |
$mMinorEdit | |
$mOldId | |
$mPreparedEdit = false | |
Title object if set. | |
$mRedirectedFrom = null | |
Title object if set. | |
$mRedirectTarget = null | |
Title object if set. | |
$mRedirectUrl = false | |
$mRevIdFetched = 0 | |
$mRevision | |
$mTimestamp = '' | |
$mTitle | |
$mTotalAdjustment = 0 | |
$mTouched = '19700101000000' | |
$mUser = -1 | |
Not loaded. | |
$mUserText = '' | |
Protected Member Functions | |
pageData ($dbr, $conditions) | |
Fetch a page record with the given conditions. | |
pageDataFromId ($dbr, $id) | |
getSelectOptions ($options= '') | |
Get options for all SELECT statements. | |
loadLastEdit () | |
Loads everything except the text This isn't necessary for all uses, so it's only done if needed. | |
showDeletionLog () | |
useParserCache ($oldid) | |
tryFileCache () | |
checkLastModified returns true if it has taken care of all output to the client that is necessary for this request. | |
pageCountInfo ($title) | |
Return the total number of edits and number of unique editors on a given page. | |
Static Protected Member Functions | |
static | flattenRestrictions ($limit) |
Take an array of page restrictions and flatten it to a string suitable for insertion into the page_restrictions field. |
See design.txt for an overview. Note: edit user interface and cache support functions have been moved to separate EditPage and HTMLFileCache classes.
Definition at line 15 of file Article.php.
Article::__construct | ( | Title $ | title, | |
$ | oldId = null | |||
) |
Constructor and clear the article.
$title | Reference to a Title object. | |
$oldId | Integer revision ID, null to fetch from request, zero for current |
Definition at line 50 of file Article.php.
Article::addTrackbacks | ( | ) |
Article::checkTouched | ( | ) |
Loads page_touched and returns a value indicating if it should be used.
Definition at line 3146 of file Article.php.
References loadPageData().
Referenced by view().
Article::clear | ( | ) |
Article::commitRollback | ( | $ | fromP, | |
$ | summary, | |||
$ | bot, | |||
&$ | resultDetails | |||
) |
Backend implementation of doRollback(), please refer there for parameter and return value documentation.
NOTE: This function does NOT check ANY permissions, it just commits the rollback to the DB Therefore, you should only call this function direct- ly if you want to use custom permissions checks. If you don't, use doRollback() instead.
Definition at line 2678 of file Article.php.
References $args, $bot, $dbw, $flags, $s, $status, $summary, $user, $wgLang, $wgUser, $wgUseRCPatrol, doEdit(), Revision::newFromId(), Revision::newFromTitle(), wfGetDB(), wfMsgForContent(), wfMsgReplaceArgs(), wfReadOnly(), wfRunHooks(), and wfTimestamp().
Referenced by doRollback().
Article::confirmDelete | ( | $ | reason | ) |
Output deletion confirmation dialog.
$reason | String: prefilled reason |
Definition at line 2383 of file Article.php.
References $reason, $wgOut, $wgUser, Xml::checkLabel(), Xml::closeElement(), Xml::hidden(), Xml::input(), Xml::label(), Xml::listDropDown(), Xml::openElement(), LogEventsList::showLogExtract(), Xml::submitButton(), Xml::tags(), wfDebug(), wfMsg(), wfMsgExt(), wfMsgForContent(), and wfMsgHtml().
Referenced by delete().
Article::createUpdates | ( | $ | rev | ) |
Perform article updates on a special page creation.
$rev | Revision object |
Definition at line 3001 of file Article.php.
References editUpdates(), isCountable(), and wfTimestamp().
Article::delete | ( | ) |
Reimplemented in ImagePage.
Definition at line 2224 of file Article.php.
References $conds, $dbw, $reason, $wgDeleteRevisionsLimit, $wgLang, $wgOut, $wgRequest, $wgUser, confirmDelete(), doDelete(), doUnwatch(), doWatch(), Xml::element(), generateReason(), isBigDeletion(), LogPage::logName(), LogEventsList::showLogExtract(), wfGetDB(), wfMsg(), wfMsgExt(), wfMsgForContent(), and wfReadOnly().
Article::deletetrackback | ( | ) |
Definition at line 1155 of file Article.php.
References $db, $wgOut, $wgRequest, $wgTitle, $wgUser, and wfGetDB().
Article::doDelete | ( | $ | reason, | |
$ | suppress = false | |||
) |
Perform a deletion and output success or failure messages.
Definition at line 2462 of file Article.php.
References $error, $reason, $wgOut, $wgUser, doDeleteArticle(), Xml::element(), LogPage::logName(), LogEventsList::showLogExtract(), wfMsg(), wfMsgExt(), wfMsgNoTrans(), and wfRunHooks().
Referenced by delete().
Article::doDeleteArticle | ( | $ | reason, | |
$ | suppress = false , |
|||
$ | id = 0 | |||
) |
Back-end article deletion Deletes the article with database consistency, writes logs, purges caches Returns success.
Definition at line 2496 of file Article.php.
References $dbw, $ns, $ok, $reason, $res, $row, $t, $u, $wgDeferredUpdateList, $wgUseSquid, $wgUseTrackbacks, Revision::DELETED_COMMENT, Revision::DELETED_RESTRICTED, Revision::DELETED_TEXT, Revision::DELETED_USER, getRawText(), isCountable(), onArticleDelete(), updateCategoryCounts(), wfDebug(), and wfGetDB().
Referenced by doDelete().
Article::doEdit | ( | $ | text, | |
$ | summary, | |||
$ | flags = 0 , |
|||
$ | baseRevId = false , |
|||
$ | user = null | |||
) |
Change an existing article or create a new article. Updates RC and all necessary caches, optionally via the deferred update array.
$wgUser must be set before calling this function.
$text | String: new text | |
$summary | String: edit summary | |
$flags | Integer 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_DEFER_UPDATES Defer some of the updates until the end of index.php EDIT_AUTOSUMMARY Fill in blank summaries with generated text where possible |
$baseRevId | the revision ID this edit was based off, if any | |
$user | Optional user object, $wgUser will be used if not passed |
$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
Compatibility note: this function previously returned a boolean value indicating success/failure
Definition at line 1549 of file Article.php.
References $bot, $changed, $dbw, $flags, $ok, $revision, $status, $summary, $text, $user, $wgDBtransactions, $wgUseAutomaticEditSummaries, $wgUseNPPatrol, $wgUser, $wgUseRCPatrol, editUpdates(), getAutosummary(), getRawText(), getRevIdFetched(), getTimestamp(), insertOn(), isCountable(), loadPageData(), Status::newGood(), RecentChange::notifyEdit(), RecentChange::notifyNew(), onArticleCreate(), onArticleEdit(), prepareTextForEdit(), PatrolLog::record(), updateRevisionOn(), wfDebug(), wfDoUpdates(), wfGetDB(), wfProfileIn(), wfProfileOut(), wfRunHooks(), and wfTimestampNow().
Referenced by commitRollback(), insertNewArticle(), and updateArticle().
Article::doPurge | ( | ) |
Perform the actions of a page purging.
Reimplemented in ImagePage.
Definition at line 1208 of file Article.php.
References $dbw, $text, $wgMessageCache, $wgUseSquid, getID(), getRawText(), SquidUpdate::newSimplePurge(), and wfGetDB().
Referenced by purge().
Article::doRedirect | ( | $ | noRedir = false , |
|
$ | sectionAnchor = '' , |
|||
$ | extraQuery = '' | |||
) |
Output a redirect back to the article.
This is typically used after an edit.
$noRedir | Boolean: add redirect=no | |
$sectionAnchor | String: section to redirect to, including "#" | |
$extraQuery | String: extra query params |
Definition at line 1801 of file Article.php.
References $wgOut.
Referenced by insertNewArticle(), showArticle(), and updateArticle().
Article::doRollback | ( | $ | fromP, | |
$ | summary, | |||
$ | token, | |||
$ | bot, | |||
&$ | resultDetails | |||
) |
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 $wgUser, then calls commitRollback() to do the dirty work
$fromP | String: Name of the user whose edits to rollback. | |
$summary | String: Custom summary. Set to default summary if empty. | |
$token | String: Rollback token. | |
$bot | Boolean: If true, mark all reverted edits as bot. | |
$resultDetails | Array: contains result-specific array of additional values 'alreadyrolled' : 'current' (rev) success : 'summary' (str), 'current' (rev), 'target' (rev) |
Definition at line 2647 of file Article.php.
References $bot, $summary, $wgUser, commitRollback(), and wfArrayDiff2().
Referenced by rollback().
Article::doUnwatch | ( | ) |
Stop watching a page.
Definition at line 1926 of file Article.php.
References $wgUser, and wfRunHooks().
Referenced by delete(), insertNewArticle(), unwatch(), and updateArticle().
Article::doWatch | ( | ) |
Add this page to $wgUser's watchlist.
Definition at line 1889 of file Article.php.
References $wgUser, and wfRunHooks().
Referenced by delete(), insertNewArticle(), updateArticle(), and watch().
Article::editUpdates | ( | $ | text, | |
$ | summary, | |||
$ | minoredit, | |||
$ | timestamp_of_pagechange, | |||
$ | newid, | |||
$ | changed = true | |||
) |
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.
$text | New text of the article | |
$summary | Edit summary | |
$minoredit | Minor edit | |
$timestamp_of_pagechange | Timestamp associated with the page change | |
$newid | rev_id value of the new revision | |
$changed | Whether or not the content actually changed |
Definition at line 2907 of file Article.php.
References $changed, $dbw, $sql, $text, $title, $u, $wgDeferredUpdateList, $wgEnableParserCache, $wgMessageCache, $wgParser, $wgRCMaxAge, $wgUser, getID(), User::isIP(), User::newFromName(), prepareTextForEdit(), ParserCache::singleton(), wfDebug(), wfGetDB(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by createUpdates(), and doEdit().
Article::estimateRevisionCount | ( | ) |
Definition at line 2325 of file Article.php.
References $dbr, and wfGetDB().
Referenced by isBigDeletion().
Article::exists | ( | ) |
Definition at line 545 of file Article.php.
Referenced by ProtectionForm::__construct(), hasViewableContent(), isCurrent(), and useParserCache().
Article::fetchContent | ( | $ | oldid = 0 |
) |
Get text of an article from database Does *NOT* follow redirects.
$oldid | Int: 0 for whatever the latest revision is |
Definition at line 433 of file Article.php.
References $dbr, $revision, $t, Revision::FOR_THIS_USER, loadPageData(), Title::makeTitle(), Revision::newFromId(), pageDataFromId(), pageDataFromTitle(), wfDebug(), wfGetDB(), wfMsg(), wfMsgExt(), wfRunHooks(), and wfTimestamp().
Referenced by isRedirect(), and loadContent().
static Article::flattenRestrictions | ( | $ | limit | ) | [static, protected] |
Take an array of page restrictions and flatten it to a string suitable for insertion into the page_restrictions field.
$limit | Array |
Definition at line 2126 of file Article.php.
References $action.
Referenced by updateRestrictions().
Article::followRedirect | ( | ) |
Get the Title object this page redirects to.
Reimplemented in ImagePage.
Definition at line 127 of file Article.php.
References $text, followRedirectText(), and getContent().
Article::followRedirectText | ( | $ | text | ) |
Get the Title object this text redirects to.
Definition at line 137 of file Article.php.
References $source, $text, and Title::newFromRedirectRecurse().
Referenced by followRedirect().
Article::forUpdate | ( | $ | x = NULL |
) |
Read/write accessor to select FOR UPDATE.
$x | Mixed: FIXME |
Definition at line 498 of file Article.php.
References wfSetVar().
Article::generateReason | ( | &$ | hasHistory | ) |
Auto-generates a deletion reason.
&$hasHistory | Boolean: whether the page has a history |
Definition at line 2144 of file Article.php.
References $dbw, $reason, $res, $row, $wgContLang, getID(), Revision::newFromTitle(), wfGetDB(), and wfMsgForContent().
Referenced by delete().
static Article::getAutosummary | ( | $ | oldtext, | |
$ | newtext, | |||
$ | flags | |||
) | [static] |
Return an applicable autosummary if one exists for the given edit.
$oldtext | String: the previous text of the page. | |
$newtext | String: The submitted text of the page. | |
$flags | Bitmask: a bitmask of flags submitted for the edit. |
Definition at line 3505 of file Article.php.
References $flags, $wgContLang, Title::newFromRedirect(), and wfMsgForContent().
Referenced by doEdit().
Article::getComment | ( | ) |
Article::getContent | ( | ) |
Note that getContent/loadContent do not follow redirects anymore.
If you need to fetch redirectable content easily, try the shortcut in Article::followContent()
Reimplemented in ImagePage.
Definition at line 207 of file Article.php.
References $text, $wgContLang, $wgMessageCache, $wgOut, $wgUser, getID(), loadContent(), wfEmptyMsg(), wfMsgExt(), wfMsgGetKey(), wfProfileIn(), and wfProfileOut().
Referenced by followRedirect(), getUndoText(), insertRedirect(), prepareTextForEdit(), and view().
Article::getContributors | ( | $ | limit = 0 , |
|
$ | offset = 0 | |||
) |
$limit | Integer: default 0. | |
$offset | Integer: default 0. |
Definition at line 690 of file Article.php.
References $dbr, $offset, $res, $sql, $user, Revision::DELETED_USER, getSelectOptions(), getUser(), and wfGetDB().
Referenced by Credits::getContributors().
Article::getCount | ( | ) |
Definition at line 564 of file Article.php.
References $dbr, getID(), getSelectOptions(), and wfGetDB().
Article::getDB | ( | ) |
Get the database which should be used for reads.
Definition at line 508 of file Article.php.
References wfDeprecated(), and wfGetDB().
Article::getHiddenCategories | ( | ) |
Returns a list of hidden categories this page is a member of.
Uses the page_props and categorylinks tables.
Definition at line 3477 of file Article.php.
References $dbr, $res, $result, $row, Title::makeTitle(), and wfGetDB().
Article::getID | ( | ) |
Definition at line 534 of file Article.php.
Referenced by addTrackbacks(), doPurge(), editUpdates(), generateReason(), ImagePage::getContent(), getContent(), getCount(), getRedirectTarget(), insertRedirect(), isFileCacheable(), loadLastEdit(), ImagePage::view(), view(), and viewUpdates().
Article::getLastNAuthors | ( | $ | num, | |
$ | revLatest = 0 | |||
) |
Get the last N authors.
$num | Integer: number of revisions to get | |
$revLatest | String: the latest rev_id, selected from the master (optional) |
Definition at line 2340 of file Article.php.
References $db, $res, $row, getSelectOptions(), wfGetDB(), wfProfileIn(), and wfProfileOut().
Article::getLatest | ( | ) |
Get the page_latest field.
Definition at line 3167 of file Article.php.
References loadPageData().
Referenced by updateRestrictions(), and view().
Article::getMinorEdit | ( | ) |
Article::getOldID | ( | ) |
Definition at line 290 of file Article.php.
References getOldIDFromRequest().
Referenced by isCurrent(), loadContent(), and view().
Article::getOldIDFromRequest | ( | ) |
Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect.
Definition at line 302 of file Article.php.
References $wgRequest.
Referenced by getOldID().
Article::getRawText | ( | ) |
Get the text of the current revision.
No side-effects...
Definition at line 237 of file Article.php.
References $text, and Revision::newFromTitle().
Referenced by doDeleteArticle(), doEdit(), and doPurge().
Article::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 ImagePage.
Definition at line 80 of file Article.php.
References $dbr, $row, getID(), insertRedirect(), Title::makeTitle(), and wfGetDB().
Article::getRevIdFetched | ( | ) |
Definition at line 681 of file Article.php.
References loadLastEdit().
Referenced by doEdit(), outputWikiText(), and view().
Article::getSection | ( | $ | text, | |
$ | section | |||
) |
This function returns the text of a section, specified by a number ($section).
A section is text under a heading like == Heading == or <h1>Heading</h1>, or the first section before any such heading (section 0).
If a section contains subsections, these are also returned.
$text | String: text to look in | |
$section | Integer: section number |
Definition at line 259 of file Article.php.
Article::getSelectOptions | ( | $ | options = '' |
) | [protected] |
Get options for all SELECT statements.
$options | Array: an optional options array which'll be appended to the default |
Definition at line 520 of file Article.php.
References $options.
Referenced by getContributors(), getCount(), getLastNAuthors(), info(), and pageCountInfo().
Article::getTimestamp | ( | ) |
Definition at line 652 of file Article.php.
References loadLastEdit(), and wfTimestamp().
Referenced by doEdit(), and Credits::getAuthor().
Article::getTitle | ( | ) |
get the title object of the article
Definition at line 173 of file Article.php.
Referenced by ImagePage::imageRedirects(), ImagePage::openShowImage(), Credits::othersLink(), and updateRedirectOn().
Article::getTouched | ( | ) |
Get the text 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 272 of file Article.php.
References getContent(), Revision::getText(), and wfMerge().
Article::getUsedTemplates | ( | ) |
Return a list of templates used by this article.
Uses the templatelinks table
Definition at line 3451 of file Article.php.
References $dbr, $res, $result, $row, Title::makeTitle(), and wfGetDB().
Article::getUser | ( | ) |
Definition at line 660 of file Article.php.
References loadLastEdit().
Referenced by Credits::getAuthor(), and getContributors().
Article::getUserText | ( | ) |
Article::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 CategoryPage.
Definition at line 557 of file Article.php.
References exists().
Referenced by view().
static Article::incViewCount | ( | $ | id | ) | [static] |
Used to increment the view counter.
$id | Integer: article id |
Definition at line 3206 of file Article.php.
References $dbw, $res, $row, $wgDBtype, $wgHitcounterUpdateFreq, wfGetDB(), wfProfileIn(), and wfProfileOut().
Referenced by viewUpdates().
Article::info | ( | ) |
Info about this page Called for ?action=info when $wgAllowPageInfo is on.
Definition at line 3359 of file Article.php.
References $dbr, $msg, $page, $wgAllowPageInfo, $wgLang, $wgOut, $wgUser, getSelectOptions(), pageCountInfo(), wfGetDB(), wfMsg(), wfMsgExt(), wfMsgHtml(), and wfMsgWeirdKey().
Article::insertNewArticle | ( | $ | text, | |
$ | summary, | |||
$ | isminor, | |||
$ | watchthis, | |||
$ | suppressRC = false , |
|||
$ | comment = false , |
|||
$ | bot = false | |||
) |
Definition at line 1432 of file Article.php.
References $bot, $dbw, $flags, $summary, $text, doEdit(), doRedirect(), doUnwatch(), doWatch(), isRedirect(), wfDeprecated(), wfGetDB(), and wfMsgForContent().
Article::insertOn | ( | $ | dbw | ) |
Insert a new empty page record for this article.
This *must* be followed up by creating a revision and running $this->updateToLatest( $rev_id ); or else the record will be left in a funky state. Best if all done inside a transaction.
$dbw | Database |
Definition at line 1244 of file Article.php.
References $affected, $dbw, wfProfileIn(), wfProfileOut(), and wfRandom().
Referenced by doEdit().
Article::insertRedirect | ( | ) |
Insert an entry for this page into the redirect table.
Don't call this function directly unless you know what you're doing.
Definition at line 105 of file Article.php.
References $dbw, getContent(), getID(), Title::newFromRedirect(), and wfGetDB().
Referenced by getRedirectTarget().
Article::isBigDeletion | ( | ) |
Definition at line 2313 of file Article.php.
References $wgDeleteRevisionsLimit, and estimateRevisionCount().
Referenced by delete().
Article::isCountable | ( | $ | text | ) |
Determine whether a page would be suitable for being counted as an article in the site_stats table based on the title & its content.
$text | String: text to analyze |
Definition at line 589 of file Article.php.
References $text, $wgUseCommaCount, in_string(), and isRedirect().
Referenced by createUpdates(), doDeleteArticle(), and doEdit().
Article::isCurrent | ( | ) |
Returns true if the currently-referenced revision is the current edit to this page (and it exists).
Definition at line 621 of file Article.php.
References exists(), and getOldID().
Referenced by outputWikiText(), and view().
Article::isFileCacheable | ( | ) |
Check if the page can be cached.
Definition at line 3130 of file Article.php.
References getID(), HTMLFileCache::useFileCache(), and wfRunHooks().
Referenced by tryFileCache().
Article::isRedirect | ( | $ | text = false |
) |
Tests if the article text represents a redirect.
$text | String: FIXME |
Reimplemented in ImagePage.
Definition at line 602 of file Article.php.
References $text, fetchContent(), loadContent(), Title::newFromRedirect(), and Title::newFromRedirectRecurse().
Referenced by insertNewArticle(), isCountable(), showArticle(), and updateArticle().
Article::loadContent | ( | ) |
Load the revision (including text) into this object.
Definition at line 331 of file Article.php.
References fetchContent(), getOldID(), wfProfileIn(), and wfProfileOut().
Referenced by getContent(), and isRedirect().
Article::loadLastEdit | ( | ) | [protected] |
Loads everything except the text This isn't necessary for all uses, so it's only done if needed.
Definition at line 633 of file Article.php.
References getID(), Revision::loadFromPageId(), and wfGetDB().
Referenced by getComment(), getMinorEdit(), getRevIdFetched(), getTimestamp(), getUser(), and getUserText().
Article::loadPageData | ( | $ | data = 'fromdb' |
) |
Set the general counter, title etc data loaded from some source.
$data | Database row object or "fromdb" |
Definition at line 398 of file Article.php.
References $dbr, pageDataFromId(), LinkCache::singleton(), wfGetDB(), and wfTimestamp().
Referenced by checkTouched(), doEdit(), fetchContent(), getLatest(), getTouched(), and view().
Article::markpatrolled | ( | ) |
Mark this particular edit/page as patrolled.
Definition at line 1816 of file Article.php.
References $dbw, $wgOut, $wgRequest, $wgUseNPPatrol, $wgUser, $wgUseRCPatrol, SpecialPage::getTitleFor(), RecentChange::newFromId(), wfGetDB(), and wfMsg().
static Article::newFromID | ( | $ | id | ) | [static] |
Constructor from an article article.
$id | The article ID to load |
Definition at line 59 of file Article.php.
References $t.
static Article::onArticleCreate | ( | $ | title | ) | [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 | a title object |
Definition at line 3275 of file Article.php.
References $title.
Referenced by doEdit(), WikiRevision::importOldRevision(), Title::moveToNewTitle(), and PageArchive::undeleteRevisions().
static Article::onArticleDelete | ( | $ | title | ) | [static] |
Definition at line 3290 of file Article.php.
References $title, $user, $wgMessageCache, HTMLFileCache::clearFileCache(), User::newFromName(), and RepoGroup::singleton().
Referenced by doDeleteArticle().
static Article::onArticleEdit | ( | $ | title, | |
$ | flags = '' | |||
) | [static] |
Purge caches on page update etc.
Definition at line 3328 of file Article.php.
References $title, $wgDeferredUpdateList, and HTMLFileCache::clearFileCache().
Referenced by doEdit(), WikiRevision::importOldRevision(), and PageArchive::undeleteRevisions().
Article::outputWikiText | ( | $ | text, | |
$ | cache = true | |||
) |
Add the primary page-view wikitext to the output buffer Saves the text into the parser cache if possible.
Updates templatelinks if it is out of date.
$text | String | |
$cache | Boolean |
Definition at line 3550 of file Article.php.
References $dbr, $key, $ns, $res, $row, $text, $u, $wgContLang, $wgEnableParserCache, $wgOut, $wgParser, $wgUseFileCache, $wgUser, getRevIdFetched(), isCurrent(), ParserCache::singleton(), wfGetDB(), and wfReadOnly().
Referenced by view().
Article::pageCountInfo | ( | $ | title | ) | [protected] |
Return the total number of edits and number of unique editors on a given page.
If page does not exist, returns false.
$title | Title object |
Definition at line 3421 of file Article.php.
References $dbr, $title, getSelectOptions(), and wfGetDB().
Referenced by info().
Article::pageData | ( | $ | dbr, | |
$ | conditions | |||
) | [protected] |
Fetch a page record with the given conditions.
$dbr | Database object | |
$conditions | Array |
Definition at line 349 of file Article.php.
References $dbr, $fields, $row, and wfRunHooks().
Referenced by pageDataFromId(), and pageDataFromTitle().
Article::pageDataFromId | ( | $ | dbr, | |
$ | id | |||
) | [protected] |
$dbr | Database | |
$id | Integer |
Definition at line 388 of file Article.php.
References $dbr, and pageData().
Referenced by fetchContent(), and loadPageData().
Article::pageDataFromTitle | ( | $ | dbr, | |
$ | title | |||
) |
Definition at line 378 of file Article.php.
References $dbr, $title, and pageData().
Referenced by fetchContent().
Article::prepareTextForEdit | ( | $ | text, | |
$ | revid = null | |||
) |
Prepare text which is about to be saved.
Returns a stdclass with source, pst and output members
Definition at line 2874 of file Article.php.
References $options, $text, $wgParser, getContent(), and preSaveTransform().
Referenced by doEdit(), and editUpdates().
Article::preSaveTransform | ( | $ | text | ) |
This function is called right before saving the wikitext, so we can do things like signatures and links-in-context.
$text | String |
Definition at line 3091 of file Article.php.
References $text, $wgParser, $wgUser, and ParserOptions::newFromUser().
Referenced by prepareTextForEdit().
Article::protect | ( | ) |
Article::purge | ( | ) |
Handle action=purge.
Definition at line 1184 of file Article.php.
References $action, $wgOut, $wgRequest, $wgUser, doPurge(), view(), wfMsgExt(), and wfRunHooks().
Article::quickEdit | ( | $ | text, | |
$ | comment = '' , |
|||
$ | minor = 0 | |||
) |
Edit an article without doing all that other stuff The article must already exist; link tables etc are not updated, caches are not flushed.
$text | String: text submitted | |
$comment | String: comment submitted | |
$minor | Boolean: whereas it's a minor modification |
Definition at line 3183 of file Article.php.
References $dbw, $minor, $revision, $text, $wgUser, updateRevisionOn(), wfGetDB(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Article::render | ( | ) |
Article::replaceSection | ( | $ | section, | |
$ | text, | |||
$ | summary = '' , |
|||
$ | edittime = NULL | |||
) |
$section | empty/null/false or a section number (0, 1, 2, T1, T2...) |
Definition at line 1395 of file Article.php.
References $dbw, $section, $summary, $text, $wgParser, Revision::loadFromTimestamp(), Revision::newFromTitle(), wfDebug(), wfGetDB(), wfMsgForContent(), wfProfileIn(), and wfProfileOut().
Article::revert | ( | ) |
#@-
Overriden by ImagePage class, only present here to avoid a fatal error Called for ?action=revert
Reimplemented in ImagePage.
Definition at line 3350 of file Article.php.
References $wgOut.
Article::rollback | ( | ) |
User interface for rollback operations.
Definition at line 2786 of file Article.php.
References $error, $out, $result, $wgOut, $wgRequest, $wgUser, $wgUseRCPatrol, doRollback(), wfMsg(), and wfMsgExt().
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 ->.
$oldid | String: revision ID of this article revision |
Definition at line 3016 of file Article.php.
References $revision, $wgLang, $wgOut, $wgRequest, $wgUser, Revision::DELETED_RESTRICTED, SpecialPage::getTitleFor(), Revision::newFromId(), wfEmptyMsg(), wfMsg(), wfMsgExt(), wfMsgHtml(), and wfRunHooks().
Referenced by view().
Article::setRedirectedFrom | ( | $ | from | ) |
Tell the page view functions that this view was redirected from another page on the wiki.
$from | Title object. |
Definition at line 69 of file Article.php.
Article::showArticle | ( | $ | text, | |
$ | subtitle, | |||
$ | sectionanchor = '' , |
|||
$ | me2, | |||
$ | now, | |||
$ | summary, | |||
$ | oldid | |||
) |
Definition at line 1788 of file Article.php.
References $text, doRedirect(), isRedirect(), and wfDeprecated().
Article::showDeletionLog | ( | ) | [protected] |
Definition at line 1044 of file Article.php.
References $wgOut, $wgUser, LogEventsList::endLogEventsList(), SpecialPage::getTitleFor(), and wfMsgHtml().
Referenced by view().
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)
Definition at line 3103 of file Article.php.
References isFileCacheable(), and wfDebug().
Referenced by view().
Article::unprotect | ( | ) |
Article::unwatch | ( | ) |
User interface handler for the "unwatch" action.
Definition at line 1904 of file Article.php.
References $wgOut, $wgUser, doUnwatch(), wfMsg(), and wfReadOnly().
Article::updateArticle | ( | $ | text, | |
$ | summary, | |||
$ | minor, | |||
$ | watchthis, | |||
$ | forceBot = false , |
|||
$ | sectionanchor = '' | |||
) |
Definition at line 1466 of file Article.php.
References $dbw, $flags, $minor, $status, $summary, $text, doEdit(), doRedirect(), doUnwatch(), doWatch(), isRedirect(), wfDeprecated(), wfGetDB(), and wfRunHooks().
Article::updateCategoryCounts | ( | $ | added, | |
$ | deleted | |||
) |
Update all the appropriate counts in the category table, given that we've added the categories $added and deleted the categories $deleted.
$added | array The names of categories that were added | |
$deleted | array The names of categories that were deleted |
Definition at line 3626 of file Article.php.
References $added, $dbw, $ns, and wfGetDB().
Referenced by doDeleteArticle().
Article::updateIfNewerOn | ( | &$ | dbw, | |
$ | revision | |||
) |
If the given revision is newer than the currently set page_latest, update the page record.
Otherwise, do nothing.
Definition at line 1365 of file Article.php.
References $dbw, $revision, $row, updateRevisionOn(), wfProfileIn(), wfProfileOut(), and wfTimestamp().
Article::updateRedirectOn | ( | &$ | dbw, | |
$ | redirectTitle, | |||
$ | lastRevIsRedirect = null | |||
) |
Add row to the redirect table if this is a redirect, remove otherwise.
$dbw | Database | |
$redirectTitle | a title object pointing to the redirect target, or NULL if this is not a redirect | |
$lastRevIsRedirect | If given, will optimize adding and removing rows in redirect table. |
Definition at line 1329 of file Article.php.
References $dbw, getTitle(), RepoGroup::singleton(), wfProfileIn(), and wfProfileOut().
Referenced by updateRevisionOn().
Article::updateRestrictions | ( | $ | limit = array() , |
|
$ | reason = '' , |
|||
&$ | cascade = 0 , |
|||
$ | expiry = array() | |||
) |
Update the article's restriction field, and leave a log entry.
$limit | Array: set of restriction keys | |
$reason | String | |
&$cascade | Integer. Set to false if cascading protection isn't allowed. | |
$expiry | Array: per restriction type expiration |
Definition at line 1962 of file Article.php.
References $action, $changed, $dbw, $reason, $wgContLang, $wgRestrictionTypes, $wgUser, Block::encodeExpiry(), flattenRestrictions(), getLatest(), Revision::newNullRevision(), Title::purgeExpiredRestrictions(), wfDebug(), wfGetDB(), wfMsgForContent(), wfReadOnly(), and wfRunHooks().
Article::updateRevisionOn | ( | &$ | dbw, | |
$ | revision, | |||
$ | lastRevision = null , |
|||
$ | lastRevIsRedirect = null | |||
) |
Update the page record to point to a newly saved revision.
$dbw | Database object | |
$revision | Revision: For ID number, and text used to set length and redirect status fields | |
$lastRevision | Integer: 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. | |
$lastRevIsRedirect | Boolean: if given, will optimize adding and removing rows in redirect table. |
Definition at line 1286 of file Article.php.
References $dbw, $result, $revision, $text, Title::newFromRedirect(), updateRedirectOn(), wfProfileIn(), and wfProfileOut().
Referenced by doEdit(), quickEdit(), and updateIfNewerOn().
Article::useParserCache | ( | $ | oldid | ) | [protected] |
Definition at line 1072 of file Article.php.
References $wgEnableParserCache, $wgUser, and exists().
Referenced by view().
Article::view | ( | ) |
This is the default action of the script: just view the page of the given title.
Reimplemented in CategoryPage, and ImagePage.
Definition at line 724 of file Article.php.
References $ns, $purge, $s, $t, $text, $wgArticleRobotPolicies, $wgContLang, $wgDefaultRobotPolicy, $wgEnableParserCache, $wgNamespaceRobotPolicies, $wgOut, $wgParser, $wgRedirectSources, $wgRequest, $wgStylePath, $wgUseETag, $wgUser, $wgUseTrackbacks, addTrackbacks(), checkTouched(), Revision::DELETED_TEXT, Xml::escapeJsString(), getContent(), getID(), getLatest(), getOldID(), getRevIdFetched(), hasViewableContent(), isCurrent(), IP::isValid(), loadPageData(), Title::newFromRedirectArray(), ParserOptions::newFromUser(), Title::newMainPage(), outputWikiText(), setOldSubtitle(), showDeletionLog(), ParserCache::singleton(), tryFileCache(), useParserCache(), viewRedirect(), viewUpdates(), wfDebug(), wfDebugLog(), wfIncrStats(), wfMsgExt(), wfMsgForContent(), wfMsgHtml(), wfProfileIn(), wfProfileOut(), wfRunHooks(), and wfTime().
Referenced by purge(), render(), and CategoryPage::view().
Article::viewRedirect | ( | $ | target, | |
$ | appendSubtitle = true , |
|||
$ | forceKnown = false | |||
) |
View redirect.
$target | Title object or Array of destination(s) to redirect | |
$appendSubtitle | Boolean [optional] | |
$forceKnown | Boolean: should the image be shown as a bluelink regardless of existence? |
Definition at line 1089 of file Article.php.
References $title, $wgContLang, $wgOut, $wgParser, $wgStylePath, $wgUser, and wfMsgHtml().
Referenced by ImagePage::view(), and view().
Article::viewUpdates | ( | ) |
Do standard deferred updates after page view.
Definition at line 2858 of file Article.php.
References $u, $wgDeferredUpdateList, $wgDisableCounters, $wgUser, getID(), and incViewCount().
Referenced by ImagePage::view(), and view().
Article::watch | ( | ) |
User-interface handler for the "watch" action.
Definition at line 1867 of file Article.php.
References $wgOut, $wgUser, doWatch(), wfMsg(), and wfReadOnly().
Article::$mComment = '' |
Article::$mContent |
Article::$mContentLoaded = false |
Article::$mCounter = -1 |
Article::$mCurID = -1 |
Article::$mDataLoaded = false |
Article::$mForUpdate = false |
Article::$mGoodAdjustment = 0 |
Article::$mIsRedirect = false |
Article::$mLatest = false |
Article::$mMinorEdit |
Article::$mOldId |
Article::$mPreparedEdit = false |
Article::$mRedirectedFrom = null |
Article::$mRedirectTarget = null |
Article::$mRedirectUrl = false |
Article::$mRevIdFetched = 0 |
Article::$mRevision |
Article::$mTimestamp = '' |
Article::$mTitle |
Article::$mTotalAdjustment = 0 |
Article::$mTouched = '19700101000000' |
Article::$mUser = -1 |
Article::$mUserText = '' |