Movatterモバイル変換


[0]ホーム

URL:


MediaWiki master
Preprocessor.php
Go to the documentation of this file.
1<?php
24namespaceMediaWiki\Parser;
25
26useWikimedia\ObjectCache\WANObjectCache;
27
31abstractclassPreprocessor {
33publicconstDOM_FOR_INCLUSION = 1;
35publicconstDOM_LANG_CONVERSION_DISABLED = 2;
37publicconstDOM_UNCACHED = 4;
38// Does preprocessing start in Start-Of-Line(SOL) state? Only relevant for Parsoid
39// content, since Parsoid models templates as independent documents in SOL start.
40// This flag is never set by the legacy parser (but see T2529 which has a similar
41// effect).
42publicconstSTART_IN_SOL_STATE = 8;
43
45public$parser;
46
48protected$wanCache;
49
51protected$disableLangConversion;
52
54protected$rules = [
55'{' => [
56'end' =>'}',
57'names' => [
58 2 =>'template',
59 3 =>'tplarg',
60 ],
61'min' => 2,
62'max' => 3,
63 ],
64'[' => [
65'end' =>']',
66'names' => [ 2 => null ],
67'min' => 2,
68'max' => 2,
69 ],
70'-{' => [
71'end' =>'}-',
72'names' => [ 2 => null ],
73'min' => 2,
74'max' => 2,
75 ],
76 ];
77
84publicfunction__construct(
87 array $options = []
88 ) {
89 $this->parser =$parser;
90 $this->wanCache =$wanCache ?: WANObjectCache::newEmpty();
91 $this->disableLangConversion = !empty( $options['disableLangConversion'] );
92 }
93
104publicfunctionresetParser( ?Parser$parser ) {
105// @phan-suppress-next-line PhanPossiblyNullTypeMismatchProperty For internal use only
106 $this->parser =$parser;
107 }
108
114abstractpublicfunctionnewFrame();
115
124abstractpublicfunctionnewCustomFrame( $args );
125
133abstractpublicfunctionnewPartNodeArray( $values );
134
154abstractpublicfunctionpreprocessToObj( $text, $flags = 0 );
155}
156
158class_alias( Preprocessor::class,'Preprocessor' );
MediaWiki\Parser\Parser
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
DefinitionParser.php:147
MediaWiki\Parser\Preprocessor
DefinitionPreprocessor.php:31
MediaWiki\Parser\Preprocessor\resetParser
resetParser(?Parser $parser)
Allows resetting the internal Parser reference after Preprocessor is cloned.
DefinitionPreprocessor.php:104
MediaWiki\Parser\Preprocessor\__construct
__construct(Parser $parser, ?WANObjectCache $wanCache=null, array $options=[])
DefinitionPreprocessor.php:84
MediaWiki\Parser\Preprocessor\$parser
Parser $parser
DefinitionPreprocessor.php:45
MediaWiki\Parser\Preprocessor\newPartNodeArray
newPartNodeArray( $values)
Create a new custom node for programmatic use of parameter replacement.
MediaWiki\Parser\Preprocessor\newFrame
newFrame()
Create a new top-level frame for expansion of a page.
MediaWiki\Parser\Preprocessor\DOM_UNCACHED
const DOM_UNCACHED
Preprocessor cache bypass flag for Preprocessor::preprocessToObj.
DefinitionPreprocessor.php:37
MediaWiki\Parser\Preprocessor\DOM_LANG_CONVERSION_DISABLED
const DOM_LANG_CONVERSION_DISABLED
Language conversion construct omission flag for Preprocessor::preprocessToObj()
DefinitionPreprocessor.php:35
MediaWiki\Parser\Preprocessor\$wanCache
WANObjectCache $wanCache
DefinitionPreprocessor.php:48
MediaWiki\Parser\Preprocessor\preprocessToObj
preprocessToObj( $text, $flags=0)
Get the document object model for the given wikitext.
MediaWiki\Parser\Preprocessor\DOM_FOR_INCLUSION
const DOM_FOR_INCLUSION
Transclusion mode flag for Preprocessor::preprocessToObj()
DefinitionPreprocessor.php:33
MediaWiki\Parser\Preprocessor\newCustomFrame
newCustomFrame( $args)
Create a new custom frame for programmatic use of parameter replacement.
MediaWiki\Parser\Preprocessor\$rules
array $rules
Brace matching rules.
DefinitionPreprocessor.php:54
MediaWiki\Parser\Preprocessor\$disableLangConversion
bool $disableLangConversion
Whether language variant conversion is disabled.
DefinitionPreprocessor.php:51
MediaWiki\Parser\Preprocessor\START_IN_SOL_STATE
const START_IN_SOL_STATE
DefinitionPreprocessor.php:42
Wikimedia\ObjectCache\WANObjectCache
Multi-datacenter aware caching interface.
DefinitionWANObjectCache.php:167
MediaWiki\Parser
DefinitionBlockLevelPass.php:27

[8]ページ先頭

©2009-2025 Movatter.jp