MediaWiki master
MediaWiki\Parser\Parsoid\Config\DataAccess Class Reference

Implement Parsoid's abstract class for data access. More...

Inherits IDataAccess.

Collaboration diagram for MediaWiki\Parser\Parsoid\Config\DataAccess:

Public Member Functions

 __construct (private readonly ServiceOptions $config, private readonly RepoGroup $repoGroup, private readonly BadFileLookup $badFileLookup, private readonly HookContainer $hookContainer, private readonly ContentTransformer $contentTransformer, private readonly TrackingCategories $trackingCategories, private readonly ReadOnlyMode $readOnlyMode, private readonly ParserFactory $parserFactory, private readonly LinkBatchFactory $linkBatchFactory, private readonly LinkRenderer $linkRenderer,)
 
 addTrackingCategory (IPageConfig $pageConfig, ContentMetadataCollector $metadata, string $key)
 Add a tracking category with the given key to the metadata for the page.
 
 fetchTemplateData (IPageConfig $pageConfig, $title)
 
 fetchTemplateSource (IPageConfig $pageConfig, $title)
 
 getExternalUrlInfo (ISiteConfig $siteConfig, array $hrefList, ParsoidLinkTarget $contextTitle)
 Return information about blocked/rewritten external URLs.
 
 getFileInfo (IPageConfig $pageConfig, array $files)
 
 getPageInfo ( $pageConfigOrTitle, array $titles, bool $defaultLinkCaption=false)
 
 logLinterData (IPageConfig $pageConfig, array $lints)
 
 makeLimitReport (IPageConfig $pageConfig, ParserOptions $parserOptions, ParserOutput $parserOutput)
 
 parseWikitext (IPageConfig $pageConfig, ContentMetadataCollector $metadata, string $wikitext,)
 
 parseWikitextWithTitle (IPageConfig $pageConfig, ContentMetadataCollector $metadata, string $wikitext, ?ParsoidLinkTarget $titleOverride=null)
 
 preprocessWikitext (IPageConfig $pageConfig, ContentMetadataCollector $metadata, $wikitext)
 

Static Public Member Functions

static unstripForParsoid (string $wikitext, Parser $parser)
 Where the result has strip state markers, tunnel this content through Parsoid as a PFragment type.
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 

Detailed Description

Implement Parsoid's abstract class for data access.

Since
1.39
Access: internal

Definition at line 51 of file DataAccess.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\Parsoid\Config\DataAccess::__construct ( private readonly ServiceOptions $config,
private readonly RepoGroup $repoGroup,
private readonly BadFileLookup $badFileLookup,
private readonly HookContainer $hookContainer,
private readonly ContentTransformer $contentTransformer,
private readonly TrackingCategories $trackingCategories,
private readonly ReadOnlyMode $readOnlyMode,
private readonly ParserFactory $parserFactory,
private readonly LinkBatchFactory $linkBatchFactory,
private readonly LinkRenderer $linkRenderer )
Parameters
ServiceOptions$configMediaWiki main configuration object
RepoGroup$repoGroup
BadFileLookup$badFileLookup
HookContainer$hookContainer
ContentTransformer$contentTransformer
TrackingCategories$trackingCategories
ReadOnlyMode$readOnlyModeused to disable linting when the database is read-only.
ParserFactory$parserFactoryA legacy parser factory, for PST/preprocessing/extension handling
LinkBatchFactory$linkBatchFactory
LinkRenderer$linkRenderer

Definition at line 77 of file DataAccess.php.

Member Function Documentation

◆ addTrackingCategory()

MediaWiki\Parser\Parsoid\Config\DataAccess::addTrackingCategory ( IPageConfig $pageConfig,
ContentMetadataCollector $metadata,
string $key )

Add a tracking category with the given key to the metadata for the page.

Parameters
IPageConfig$pageConfigthe page on which the tracking category is to be added
ContentMetadataCollector$metadataThe metadata for the page
string$keyMessage key (not localized)

Definition at line 641 of file DataAccess.php.

◆ fetchTemplateData()

MediaWiki\Parser\Parsoid\Config\DataAccess::fetchTemplateData ( IPageConfig $pageConfig,
$title )

Definition at line 613 of file DataAccess.php.

◆ fetchTemplateSource()

MediaWiki\Parser\Parsoid\Config\DataAccess::fetchTemplateSource ( IPageConfig $pageConfig,
$title )

Definition at line 595 of file DataAccess.php.

◆ getExternalUrlInfo()

MediaWiki\Parser\Parsoid\Config\DataAccess::getExternalUrlInfo ( ISiteConfig $siteConfig,
array $hrefList,
ParsoidLinkTarget $contextTitle )

Return information about blocked/rewritten external URLs.

Parameters
ISiteConfig$siteConfig
list<string>$hrefList The external URLs to query.
ParsoidLinkTarget$contextTitleThe context title, for wgNoFollowNsExceptions lookups.
Returns
list<array{originalHref:string,href:?string,class:?string,rel:?string,title:?string}> Information about the external URL: the href can be rewritten or blocked (null), and optional class, title, and rel attributes can be added (if non-null). The results are in the same order as the input $hrefList.

Definition at line 329 of file DataAccess.php.

References wfDeprecated().

◆ getFileInfo()

MediaWiki\Parser\Parsoid\Config\DataAccess::getFileInfo ( IPageConfig $pageConfig,
array $files )

Definition at line 226 of file DataAccess.php.

References $url.

◆ getPageInfo()

MediaWiki\Parser\Parsoid\Config\DataAccess::getPageInfo ( $pageConfigOrTitle,
array $titles,
bool $defaultLinkCaption = false )

Definition at line 156 of file DataAccess.php.

◆ logLinterData()

MediaWiki\Parser\Parsoid\Config\DataAccess::logLinterData ( IPageConfig $pageConfig,
array $lints )

Definition at line 653 of file DataAccess.php.

◆ makeLimitReport()

MediaWiki\Parser\Parsoid\Config\DataAccess::makeLimitReport ( IPageConfig $pageConfig,
ParserOptions $parserOptions,
ParserOutput $parserOutput )
Access: internal

Definition at line 415 of file DataAccess.php.

References MediaWiki\Parser\Parser\makeLimitReport(), and MediaWiki\Parser\Parser\OT_HTML.

◆ parseWikitext()

MediaWiki\Parser\Parsoid\Config\DataAccess::parseWikitext ( IPageConfig $pageConfig,
ContentMetadataCollector $metadata,
string $wikitext )

Definition at line 427 of file DataAccess.php.

◆ parseWikitextWithTitle()

MediaWiki\Parser\Parsoid\Config\DataAccess::parseWikitextWithTitle ( IPageConfig $pageConfig,
ContentMetadataCollector $metadata,
string $wikitext,
?ParsoidLinkTarget $titleOverride = null )

Definition at line 438 of file DataAccess.php.

◆ preprocessWikitext()

MediaWiki\Parser\Parsoid\Config\DataAccess::preprocessWikitext ( IPageConfig $pageConfig,
ContentMetadataCollector $metadata,
$wikitext )

◆ unstripForParsoid()

static MediaWiki\Parser\Parsoid\Config\DataAccess::unstripForParsoid ( string $wikitext,
Parser $parser )
static

Where the result has strip state markers, tunnel this content through Parsoid as a PFragment type.

Definition at line 530 of file DataAccess.php.

Referenced by MediaWiki\Parser\PPFrame_Hash\expand().

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\Parser\Parsoid\Config\DataAccess::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const SVGMaxSize
Name constant for the SVGMaxSize setting, for use with Config::get()

Definition at line 52 of file DataAccess.php.


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