Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Config\Api\DataAccess Class Reference

DataAccess via MediaWiki's Action API. More...

+ Inheritance diagram for Wikimedia\Parsoid\Config\Api\DataAccess:
+ Collaboration diagram for Wikimedia\Parsoid\Config\Api\DataAccess:

Public Member Functions

 __construct (ApiHelper $api, ISiteConfig $siteConfig, array $opts)
 
 getPageInfo ( $pageConfigOrTitle, array $titles)
 Return target data for formatting links.Replaces Batcher.getPageProps()
Parameters
PageConfig | LinkTarget$pageConfigOrTitleEither a PageConfig or else just the context title from the PageConfig (as a LinkTarget)
string[]$titles
Returns
array<string,array> [ string Title => array ], where the array contains
  • pageId: (int|null) Page ID
  • revId: (int|null) Current revision of the page
  • missing: (bool) Whether the page is missing
  • known: (bool) Whether the special page is known
  • redirect: (bool) Whether the page is a redirect
  • linkclasses: (string[]) Extensible "link color" information; see ApiQueryInfo::getLinkClasses() in MediaWiki core

 
 getFileInfo (PageConfig $pageConfig, array $files)
 
 parseWikitext (PageConfig $pageConfig, ContentMetadataCollector $metadata, string $wikitext)
 
 preprocessWikitext (PageConfig $pageConfig, ContentMetadataCollector $metadata, string $wikitext)
 
 fetchTemplateSource (PageConfig $pageConfig, LinkTarget $title)
 
 fetchTemplateData (PageConfig $pageConfig, LinkTarget $title)
 
 logLinterData (PageConfig $pageConfig, array $lints)
 
 addTrackingCategory (PageConfig $pageConfig, ContentMetadataCollector $metadata, string $key)
 
- Public Member Functions inherited from Wikimedia\Parsoid\Config\DataAccess
 __construct ()
 Base constructor.
 
 getFileInfo (PageConfig $pageConfig, array $files)
 Return information about files (images)
 
 parseWikitext (PageConfig $pageConfig, ContentMetadataCollector $metadata, string $wikitext)
 Perform a parse on wikitext.
 
 preprocessWikitext (PageConfig $pageConfig, ContentMetadataCollector $metadata, string $wikitext)
 Preprocess wikitext.
 
 fetchTemplateSource (PageConfig $pageConfig, LinkTarget $title)
 Fetch latest revision of article/template content for transclusion.
 
 fetchTemplateData (PageConfig $pageConfig, LinkTarget $title)
 Fetch templatedata for a title.
 
 logLinterData (PageConfig $pageConfig, array $lints)
 Log linter data.
 
 addTrackingCategory (PageConfig $pageConfig, ContentMetadataCollector $metadata, string $key)
 Add a tracking category with the given key to the metadata for the page.
 

Detailed Description

DataAccess via MediaWiki's Action API.

Note this is intended for testing, not performance.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Config\Api\DataAccess::__construct ( ApiHelper $api,
ISiteConfig $siteConfig,
array $opts )
Parameters
ApiHelper$api
ISiteConfig$siteConfig
array$opts

Member Function Documentation

◆ getPageInfo()

Wikimedia\Parsoid\Config\Api\DataAccess::getPageInfo ( $pageConfigOrTitle,
array $titles )

Return target data for formatting links.Replaces Batcher.getPageProps()

Parameters
PageConfig | LinkTarget$pageConfigOrTitleEither a PageConfig or else just the context title from the PageConfig (as a LinkTarget)
string[]$titles
Returns
array<string,array> [ string Title => array ], where the array contains
  • pageId: (int|null) Page ID
  • revId: (int|null) Current revision of the page
  • missing: (bool) Whether the page is missing
  • known: (bool) Whether the special page is known
  • redirect: (bool) Whether the page is a redirect
  • linkclasses: (string[]) Extensible "link color" information; see ApiQueryInfo::getLinkClasses() in MediaWiki core

Reimplemented from Wikimedia\Parsoid\Config\DataAccess.


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