Manual:Article.php
From MediaWiki.org
| MediaWiki File: Article.php | |
|---|---|
| Location: | /includes/ |
| Source code: | HEAD |
| Classes: | Article |
Contents |
[edit] Description
The Article class represents a MediaWiki article and its history. It encapsulates access to the way articles are stored in the database, and allows access to properties such as article text (in Wikitext format), flags, etc.
This file contains e.g. one version of function "view" for viewing a page, called from Wiki.php (another version is in RawPage.php). This function fetches the wikitext $mContent of the page from the database using functions getContent, loadContent and fetchContent, and assigns this to $text. After that it calls function addPrimaryWikiText in OutputPage.php to process $text.
[edit] Includes or Requires
- CacheManager.php (v 1.6.10)
- Revision.php (v 1.6.10)
- DifferenceEngine.php (v 1.6.10)
- RecentChanges.php (v 1.6.10)
- ProtectionForm.php (v 1.6.10)
[edit] Class Members
[edit] Article
- $mComment
- $mContent
- $mContentLoaded
- $mCounter
- $mFileCache (v 1.6.10)
- $mForUpdate
- $mGoodAdjustment
- $mId (v 1.6.10)
- $mLatest
- $mMinorEdit
- $mOldId
- $mRedirectedFrom
- $mRedirectUrl
- $mRevIdFetched
- $mRevision
- $mTable (v 1.6.10)
- $mTimestamp
- $mTitle
- $mTotalAdjustment
- $mTouched
- $mUser
- $mUserText
[edit] Hooks
Hooks called from this file are listed in the Category:MediaWiki hooks included in Article.php category.
[edit] Example
To create an Article object and print the raw wiki text from that article, for example from within an extension, you could do something like this:
$id = Title::newFromText("Test_page")->getArticleId(); //Get the id for the article called Test_page $myArticle = Article::newFromId($id); //Make an article object from that id echo $myArticle->getRawText(); //Print the raw wiki text of the article