MediaWiki  master
ParserFactory Class Reference

Public Member Functions

 __construct (ServiceOptions $svcOptions, MagicWordFactory $magicWordFactory, Language $contLang, UrlUtils $urlUtils, SpecialPageFactory $spFactory, LinkRendererFactory $linkRendererFactory, NamespaceInfo $nsInfo, LoggerInterface $logger, BadFileLookup $badFileLookup, LanguageConverterFactory $languageConverterFactory, HookContainer $hookContainer, TidyDriverBase $tidy, WANObjectCache $wanCache, UserOptionsLookup $userOptionsLookup, UserFactory $userFactory, TitleFormatter $titleFormatter, HttpRequestFactory $httpRequestFactory, TrackingCategories $trackingCategories, SignatureValidatorFactory $signatureValidatorFactory, UserNameUtils $userNameUtils)
 
 create ()
 Creates a new parser. More...
 
 getInstance ()
 Get the main shared instance, or if it is locked, get a new instance. More...
 
 getMainInstance ()
 Get the main shared instance. More...
 

Static Public Attributes

static int $inParserFactory = 0
 Track calls to Parser constructor to aid in deprecation of direct Parser invocation. More...
 

Detailed Description

Since
1.32

Definition at line 42 of file ParserFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ParserFactory::__construct ( ServiceOptions  $svcOptions,
MagicWordFactory  $magicWordFactory,
Language  $contLang,
UrlUtils  $urlUtils,
SpecialPageFactory  $spFactory,
LinkRendererFactory  $linkRendererFactory,
NamespaceInfo  $nsInfo,
LoggerInterface  $logger,
BadFileLookup  $badFileLookup,
LanguageConverterFactory  $languageConverterFactory,
HookContainer  $hookContainer,
TidyDriverBase  $tidy,
WANObjectCache  $wanCache,
UserOptionsLookup  $userOptionsLookup,
UserFactory  $userFactory,
TitleFormatter  $titleFormatter,
HttpRequestFactory  $httpRequestFactory,
TrackingCategories  $trackingCategories,
SignatureValidatorFactory  $signatureValidatorFactory,
UserNameUtils  $userNameUtils 
)
Parameters
ServiceOptions$svcOptions
MagicWordFactory$magicWordFactory
Language$contLangContent language
UrlUtils$urlUtils
SpecialPageFactory$spFactory
LinkRendererFactory$linkRendererFactory
NamespaceInfo$nsInfo
LoggerInterface$logger
BadFileLookup$badFileLookup
LanguageConverterFactory$languageConverterFactory
HookContainer$hookContainer
TidyDriverBase$tidy
WANObjectCache$wanCache
UserOptionsLookup$userOptionsLookup
UserFactory$userFactory
TitleFormatter$titleFormatter
HttpRequestFactory$httpRequestFactory
TrackingCategories$trackingCategories
SignatureValidatorFactory$signatureValidatorFactory
UserNameUtils$userNameUtils
Since
1.32
Access: internal

Definition at line 140 of file ParserFactory.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), Parser\CONSTRUCTOR_OPTIONS, and wfDebug().

Member Function Documentation

◆ create()

ParserFactory::create ( )

Creates a new parser.

Returns
Parser
Since
1.32

Definition at line 194 of file ParserFactory.php.

Referenced by Parser\Parsoid\Config\DataAccess\__construct().

◆ getInstance()

ParserFactory::getInstance ( )

Get the main shared instance, or if it is locked, get a new instance.

Since
1.39
Returns
Parser

Definition at line 246 of file ParserFactory.php.

◆ getMainInstance()

ParserFactory::getMainInstance ( )

Get the main shared instance.

This is unsafe when the caller is not in a top-level context, because re-entering the parser will throw an exception.

Since
1.39
Returns
Parser

Definition at line 233 of file ParserFactory.php.

Member Data Documentation

◆ $inParserFactory

int ParserFactory::$inParserFactory = 0
static

Track calls to Parser constructor to aid in deprecation of direct Parser invocation.

This is temporary: it will be removed once the deprecation notice period is over and the underlying method calls are refactored.

Access: internal

Definition at line 102 of file ParserFactory.php.

Referenced by Parser\__construct().


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