Extends Api of MediaWiki with actions for mobile devices.
More...
|
const | CACHE_VERSION = 9 |
| Increment this when changing the format of cached data.
|
|
Extends Api of MediaWiki with actions for mobile devices.
For further information see https://www.mediawiki.org/wiki/Extension:MobileFrontend#API
◆ __construct()
ApiMobileView::__construct |
( |
|
$main, |
|
|
|
$action |
|
) |
| |
Run constructor of ApiBase.
- Parameters
-
ApiMain | $main | Instance of class ApiMain |
string | $action | Name of this module |
◆ execute()
ApiMobileView::execute |
( |
| ) |
|
Execute the requested Api actions.
- Todo:
- Write some unit tests for API results
◆ findFile()
ApiMobileView::findFile |
( |
|
$title, |
|
|
|
$options = [] |
|
) |
| |
|
protected |
Wrapper for wfFindFile.
- Parameters
-
Title | string | $title | Page title |
array | $options | Options for wfFindFile (see RepoGroup::findFile) |
- Returns
- File|false
Reimplemented in MockApiMobileView.
◆ getAllowedParams()
ApiMobileView::getAllowedParams |
( |
| ) |
|
◆ getExamplesMessages()
ApiMobileView::getExamplesMessages |
( |
| ) |
|
|
protected |
Returns usage examples for this module.
- See also
- ApiBase::getExamplesMessages()
- Returns
- array
◆ getHelpUrls()
ApiMobileView::getHelpUrls |
( |
| ) |
|
Returns the Help URL for this Api.
- Returns
- string
◆ getMobileViewPageProps()
ApiMobileView::getMobileViewPageProps |
( |
|
$propNames, |
|
|
|
$data |
|
) |
| |
Obtain the requested page properties.
- Parameters
-
string | $propNames | requested list of pageprops separated by '|'. If '*' all page props will be returned. |
array | $data | data available as returned by getData |
- Returns
- array associative
◆ getPageImage()
ApiMobileView::getPageImage |
( |
Title |
$title | ) |
|
|
protected |
Wrapper that returns a page image for a given title.
- Parameters
-
- Returns
- File|false
Reimplemented in MockApiMobileView.
◆ getParserOutput()
ApiMobileView::getParserOutput |
( |
WikiPage |
$wikiPage, |
|
|
ParserOptions |
$parserOptions, |
|
|
|
$oldid = null |
|
) |
| |
|
protected |
Performs a page parse.
- Parameters
-
WikiPage | $wikiPage | |
ParserOptions | $parserOptions | |
null | int | $oldid | Revision ID to get the text from, passing null or 0 will get the current revision (default value) |
- Returns
- ParserOutput|bool
Reimplemented in MockApiMobileView.
◆ getRequestedSectionIds()
static ApiMobileView::getRequestedSectionIds |
( |
|
$str, |
|
|
|
$data, |
|
|
& |
$missingSections |
|
) |
| |
|
static |
Parses requested sections string into a list of sections.
- Parameters
-
string | $str | String to parse |
array | $data | Processed parser output |
array | &$missingSections | Upon return, contains the list of sections that were requested but are not present in parser output (passed by reference) |
- Returns
- array
◆ isMainPage()
ApiMobileView::isMainPage |
( |
|
$title | ) |
|
|
protected |
Check if page is the main page after follow redirect when followRedirects is true.
- Parameters
-
Title | $title | Title object to check |
- Returns
- bool
◆ makeParserOptions()
ApiMobileView::makeParserOptions |
( |
WikiPage |
$wikiPage | ) |
|
|
protected |
Call makeParserOptions on a WikiPage with the wrapper output class disabled.
- Parameters
-
WikiPage | $wikiPage | to call makeParserOptions on. |
- Returns
- ParserOptions
Reimplemented in MockApiMobileView.
◆ makeTitle()
ApiMobileView::makeTitle |
( |
|
$name | ) |
|
|
protected |
Creates and validates a title.
- Parameters
-
- Returns
- Title
Reimplemented in MockApiMobileView.
◆ makeWikiPage()
ApiMobileView::makeWikiPage |
( |
Title |
$title | ) |
|
|
protected |
Creates a WikiPage from title.
- Parameters
-
- Returns
- WikiPage
Reimplemented in MockApiMobileView.
◆ parseSectionsData()
ApiMobileView::parseSectionsData |
( |
|
$html, |
|
|
Title |
$title, |
|
|
ParserOutput |
$parserOutput, |
|
|
|
$revId = null |
|
) |
| |
|
protected |
Parses section data.
- Parameters
-
string | $html | Representing the entire page |
Title | $title | Page title |
ParserOutput | $parserOutput | |
int | null | $revId | This is a temporary parameter to avoid debug log warnings. Long term the call to wfDebugLog should be moved outside this method (optional) |
- Returns
- array Structure representing the list of sections and their properties:
- refsections: [] where all keys are section ids of sections with refs that contain references
- sections: [] a structured array of all the sections inside the page
- text: [] of the text of each individual section. length === same as sections or of length 1 when there is a mismatch.
The documentation for this class was generated from the following file:
- includes/api/ApiMobileView.php