MediaWiki REL1_37
ParserFactory.php
Go to the documentation of this file.
1<?php
32use Psr\Log\LoggerInterface;
33
39 private $svcOptions;
40
43
45 private $contLang;
46
49
52
55
57 private $nsInfo;
58
60 private $logger;
61
64
67
70
72 private $userFactory;
73
76
79
88 public static $inParserFactory = 0;
89
92
94 private $tidy;
95
97 private $wanCache;
98
120 public function __construct(
121 ServiceOptions $svcOptions,
122 MagicWordFactory $magicWordFactory,
123 Language $contLang,
124 string $urlProtocols,
125 SpecialPageFactory $spFactory,
126 LinkRendererFactory $linkRendererFactory,
127 NamespaceInfo $nsInfo,
128 LoggerInterface $logger,
129 BadFileLookup $badFileLookup,
130 LanguageConverterFactory $languageConverterFactory,
131 HookContainer $hookContainer,
132 TidyDriverBase $tidy,
133 WANObjectCache $wanCache,
135 UserFactory $userFactory,
136 TitleFormatter $titleFormatter,
137 HttpRequestFactory $httpRequestFactory
138 ) {
140
141 wfDebug( __CLASS__ . ": using default preprocessor" );
142
143 $this->svcOptions = $svcOptions;
144 $this->magicWordFactory = $magicWordFactory;
145 $this->contLang = $contLang;
146 $this->urlProtocols = $urlProtocols;
147 $this->specialPageFactory = $spFactory;
148 $this->linkRendererFactory = $linkRendererFactory;
149 $this->nsInfo = $nsInfo;
150 $this->logger = $logger;
151 $this->badFileLookup = $badFileLookup;
152 $this->languageConverterFactory = $languageConverterFactory;
153 $this->hookContainer = $hookContainer;
154 $this->tidy = $tidy;
155 $this->wanCache = $wanCache;
156 $this->userOptionsLookup = $userOptionsLookup;
157 $this->userFactory = $userFactory;
158 $this->titleFormatter = $titleFormatter;
159 $this->httpRequestFactory = $httpRequestFactory;
160 }
161
168 public function create(): Parser {
169 self::$inParserFactory++;
170 try {
171 return new Parser(
172 $this->svcOptions,
173 $this->magicWordFactory,
174 $this->contLang,
175 $this,
176 $this->urlProtocols,
177 $this->specialPageFactory,
178 $this->linkRendererFactory,
179 $this->nsInfo,
180 $this->logger,
181 $this->badFileLookup,
182 $this->languageConverterFactory,
183 $this->hookContainer,
184 $this->tidy,
185 $this->wanCache,
186 $this->userOptionsLookup,
187 $this->userFactory,
188 $this->titleFormatter,
189 $this->httpRequestFactory
190 );
191 } finally {
192 self::$inParserFactory--;
193 }
194 }
195}
UserOptionsLookup $userOptionsLookup
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition Language.php:42
A factory that stores information about MagicWords, and creates them on demand with caching.
A class for passing options to services.
assertRequiredOptions(array $expectedKeys)
Assert that the list of options provided in this instance exactly match $expectedKeys,...
Factory creating MWHttpRequest objects.
An interface for creating language converters.
Factory to create LinkRender objects.
Factory for handling the special page list and generating SpecialPage objects.
Base class for HTML cleanup utilities.
Creates User objects.
Provides access to user options.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Language $contLang
SpecialPageFactory $specialPageFactory
LoggerInterface $logger
UserFactory $userFactory
HookContainer $hookContainer
__construct(ServiceOptions $svcOptions, MagicWordFactory $magicWordFactory, Language $contLang, string $urlProtocols, 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)
TidyDriverBase $tidy
WANObjectCache $wanCache
LanguageConverterFactory $languageConverterFactory
TitleFormatter $titleFormatter
UserOptionsLookup $userOptionsLookup
LinkRendererFactory $linkRendererFactory
MagicWordFactory $magicWordFactory
ServiceOptions $svcOptions
BadFileLookup $badFileLookup
NamespaceInfo $nsInfo
static int $inParserFactory
Track calls to Parser constructor to aid in deprecation of direct Parser invocation.
HttpRequestFactory $httpRequestFactory
create()
Creates a new parser.
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
Definition Parser.php:91
const CONSTRUCTOR_OPTIONS
Definition Parser.php:372
Multi-datacenter aware caching interface.
A title formatter service for MediaWiki.