|
MediaWiki master
|
Set options of the Parser. More...
Public Member Functions | |
| __construct (UserIdentity $user, $lang=null) | |
| addExtraKey ( $key) | |
| Extra key that should be present in the parser cache key. | |
| allCacheVaryingOptionsWithPostproc () | |
| Return all option keys that vary the options hash, including postprocessing options if appropriate. | |
| clearPostproc () | |
| disableContentConversion ( $x=true) | |
| Whether content conversion should be disabled. | |
| disableTitleConversion ( $x=true) | |
| Whether title conversion should be disabled. | |
| enableLimitReport ( $x=true) | |
| enablePostproc () | |
| Indicates that these options should apply post-processing options, and ensures that the cache is split accordingly. | |
| getAllowExternalImages () | |
| Allow all external images inline? | |
| getAllowExternalImagesFrom () | |
| External images to allow. | |
| getAllowSpecialInclusion () | |
| Allow inclusion of special pages? | |
| getAllowUnsafeRawHtml () | |
| If the wiki is configured to allow raw html ($wgRawHtml = true) is it allowed in the specific case of parsing this page. | |
| getCleanSignatures () | |
| Clean up signature texts? | |
| getCollapsibleSections () | |
| Should section contents be wrapped in. | |
| getCurrentRevisionRecordCallback () | |
| Callback to fetch the current revision. | |
| getDateFormat () | |
| Date format index. | |
| getDisableContentConversion () | |
| Whether content conversion should be disabled. | |
| getDisableTitleConversion () | |
| Whether title conversion should be disabled. | |
| getEnableImageWhitelist () | |
| Use the on-wiki external image whitelist? | |
| getEnableLimitReport () | |
| getExpensiveParserFunctionLimit () | |
| Maximum number of calls per parse to expensive parser functions. | |
| getExternalLinkTarget () | |
| Target attribute for external links. | |
| getInterfaceMessage () | |
| Parsing an interface message in the user language? | |
| getInterwikiMagic () | |
| Whether to extract interlanguage links. | |
| getIsPreview () | |
| Parsing the page for a "preview" operation? | |
| getIsPrintable () | |
| Parsing the printable version of the page? | |
| getIsSectionPreview () | |
| Parsing the page for a "preview" operation on a single section? | |
| getMagicISBNLinks () | |
| Are magic ISBN links enabled? | |
| getMagicPMIDLinks () | |
| Are magic PMID links enabled? | |
| getMagicRFCLinks () | |
| Are magic RFC links enabled? | |
| getMaxIncludeSize () | |
| Maximum size of template expansions, in bytes. | |
| getMaxPPExpandDepth () | |
| Maximum recursion depth in PPFrame::expand() | |
| getMaxPPNodeCount () | |
| Maximum number of nodes touched by PPFrame::expand() | |
| getMaxTemplateDepth () | |
| Maximum recursion depth for templates within templates. | |
| getOption ( $name) | |
| Fetch an option and track that is was accessed. | |
| getPostproc () | |
| Returns usage of postprocessing (and splits the cache accordingly) | |
| getPreSaveTransform () | |
| Transform wiki markup when saving the page? | |
| getRedirectTarget () | |
| Get the previously-set redirect target. | |
| getRemoveComments () | |
| Remove HTML comments. | |
| getRenderReason () | |
| Returns reason for rendering the content. | |
| getSpeculativePageId () | |
| A guess for {{PAGEID}}, calculated using the callback provided via setSpeculativeRevPageCallback(). | |
| getSpeculativeRevId () | |
| A guess for {{REVISIONID}}, calculated using the callback provided via setSpeculativeRevIdCallback(). | |
| getSuppressSectionEditLinks () | |
| Should section edit links be suppressed? Used when parsing wikitext which will be presented in a non-interactive context: previews, UX text, etc. | |
| getSuppressTOC () | |
| Should the table of contents be suppressed? Used when parsing "code" pages (like JavaScript) as wikitext for backlink support and categories, but where we don't want other metadata generated (like the table of contents). | |
| getTargetLanguage () | |
| Target language for the parse. | |
| getTemplateCallback () | |
| Callback to fetch a template. | |
| getThumbSize () | |
| Get thumbnail size. | |
| getTimestamp () | |
| Timestamp used for {{CURRENTDAY}} etc. | |
| getUseParsoid () | |
| Parsoid-format HTML output, or legacy wikitext parser HTML? | |
| getUserIdentity () | |
| Get the identity of the user for whom the parse is made. | |
| getUserLang () | |
| Same as getUserLangObj() but returns a string instead. | |
| getUserLangObj () | |
| Get the user language used by the parser for this page and split the parser cache. | |
| getVariant () | |
| Returns the target language variant, or null if no language conversion is to be performed. | |
| getWrapOutputClass () | |
| Class to use to wrap output from Parser::parse() | |
| isMessage () | |
| Parsing a message? | |
| isSafeToCache (?array $usedOptions=null) | |
| Test whether the set of provided options are safe to cache. | |
| matches (ParserOptions $other) | |
| Check if these options match that of another options set. | |
| matchesForCacheKey (ParserOptions $other) | |
| optionsHash ( $forOptions, $title=null) | |
| Generate a hash string with the values set on these ParserOptions for the keys given in the array. | |
| registerWatcher ( $callback) | |
| Registers a callback for tracking which ParserOptions which are used. | |
| setAllowSpecialInclusion ( $x) | |
| Allow inclusion of special pages? | |
| setAllowUnsafeRawHtml ( $x) | |
| If the wiki is configured to allow raw html ($wgRawHtml = true) is it allowed in the specific case of parsing this page. | |
| setCleanSignatures ( $x) | |
| Clean up signature texts? | |
| setCollapsibleSections () | |
| Wrap section contents in a. | |
| setCurrentRevisionRecordCallback ( $x) | |
| Callback to fetch the current revision. | |
| setDateFormat ( $x) | |
| Date format index. | |
| setExpensiveParserFunctionLimit ( $x) | |
| Maximum number of calls per parse to expensive parser functions. | |
| setExternalLinkTarget ( $x) | |
| Target attribute for external links. | |
| setInterfaceMessage ( $x) | |
| Parsing an interface message in the user language? | |
| setInterwikiMagic ( $x) | |
| Specify whether to extract interlanguage links. | |
| setIsMessage ( $x) | |
| Set whether we are parsing a message. | |
| setIsPreview ( $x) | |
| Parsing the page for a "preview" operation? | |
| setIsPrintable ( $x) | |
| Parsing the printable version of the page? | |
| setIsSectionPreview ( $x) | |
| Parsing the page for a "preview" operation on a single section? | |
| setMaxIncludeSize ( $x) | |
| Maximum size of template expansions, in bytes. | |
| setMaxPPNodeCount ( $x) | |
| Maximum number of nodes touched by PPFrame::expand() | |
| setMaxTemplateDepth ( $x) | |
| Maximum recursion depth for templates within templates. | |
| setOption ( $name, $value) | |
| Set an option, generically. | |
| setPreSaveTransform ( $x) | |
| Transform wiki markup when saving the page? | |
| setRedirectTarget ( $title) | |
| Note that setting or changing this does not make the page a redirect or change its target, it merely records the information for reference during the parse. | |
| setRemoveComments ( $x) | |
| Remove HTML comments. | |
| setRenderReason (string $renderReason) | |
| Sets reason for rendering the content. | |
| setSpeculativePageIdCallback ( $x) | |
| Callback to generate a guess for {{PAGEID}}. | |
| setSpeculativeRevIdCallback ( $x) | |
| Callback to generate a guess for {{REVISIONID}}. | |
| setSuppressSectionEditLinks () | |
| Suppress section edit links in the output. | |
| setSuppressTOC () | |
| Suppress generation of the table of contents. | |
| setTargetLanguage ( $x) | |
| Target language for the parse. | |
| setTemplateCallback ( $x) | |
| Set the callback to fetch a template. | |
| setThumbSize ( $x) | |
| Thumb size preferred by the user. | |
| setTimestamp ( $x) | |
| Timestamp used for {{CURRENTDAY}} etc. | |
| setupFakeRevision ( $page, $content, $user, $currentRevId=0) | |
| Sets a hook to force that a page exists, and sets a current revision callback to return a revision with custom content when the current revision of the page is requested. | |
| setUseParsoid (bool $value=true) | |
| Request Parsoid-format HTML output. | |
| setUserLang ( $x) | |
| Set the user language used by the parser for this page and split the parser cache. | |
| setVariant (?Language $variantLanguage) | |
| Set the target language variant. | |
| setWrapOutputClass ( $className) | |
| CSS class to use to wrap output from Parser::parse() | |
Static Public Member Functions | |
| static | allCacheVaryingOptions (bool $includePostproc=false) |
| Return all option keys that vary the options hash. | |
| static | clearStaticCache () |
| Reset static caches. | |
| static | getLazyOptions () |
| Get lazy-loaded options. | |
| static | newCanonical ( $context, $userLang=null) |
| Creates a "canonical" ParserOptions object. | |
| static | newFromAnon () |
| Get a ParserOptions object for an anonymous user. | |
| static | newFromContext (IContextSource $context) |
| Get a ParserOptions object from a IContextSource object. | |
| static | newFromUser ( $user) |
| Get a ParserOptions object from a given user. | |
| static | newFromUserAndLang (UserIdentity $user, Language $lang) |
| Get a ParserOptions object from a given user and language. | |
Static Public Attributes | |
| static array list< string > | $postprocOptions |
| List of "postprocessing options", excluded from most ParserOption operations by default. | |
Protected Member Functions | |
| setOptionLegacy ( $name, $value) | |
| Legacy implementation. | |
Set options of the Parser.
How to add an option in core:
How to add an option in an extension:
Definition at line 70 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::__construct | ( | UserIdentity | $user, |
| $lang = null ) |
| UserIdentity | $user | |
| Language | null | $lang |
Definition at line 1170 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::addExtraKey | ( | $key | ) |
Extra key that should be present in the parser cache key.
| string | $key |
Definition at line 1153 of file ParserOptions.php.
|
static |
Return all option keys that vary the options hash.
| bool | $includePostproc | When false (the default) removes all options from self::$postprocOptions from the return value |
Definition at line 1586 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::allCacheVaryingOptionsWithPostproc | ( | ) |
Return all option keys that vary the options hash, including postprocessing options if appropriate.
Definition at line 1600 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::clearPostproc | ( | ) |
Definition at line 1913 of file ParserOptions.php.
|
static |
| MediaWiki\Parser\ParserOptions::disableContentConversion | ( | $x = true | ) |
Whether content conversion should be disabled.
| bool | null | $x | New value (null is no change) |
Definition at line 600 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::disableTitleConversion | ( | $x = true | ) |
Whether title conversion should be disabled.
| bool | null | $x | New value (null is no change) |
Definition at line 617 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::enableLimitReport | ( | $x = true | ) |
Enable limit report in an HTML comment on output
| bool | null | $x | New value (null is no change) |
Definition at line 545 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::enablePostproc | ( | ) |
Indicates that these options should apply post-processing options, and ensures that the cache is split accordingly.
Definition at line 1895 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getAllowExternalImages | ( | ) |
| MediaWiki\Parser\ParserOptions::getAllowExternalImagesFrom | ( | ) |
External images to allow.
When self::getAllowExternalImages() is false
Definition at line 340 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getAllowSpecialInclusion | ( | ) |
| MediaWiki\Parser\ParserOptions::getAllowUnsafeRawHtml | ( | ) |
If the wiki is configured to allow raw html ($wgRawHtml = true) is it allowed in the specific case of parsing this page.
This is meant to disable unsafe parser tags in cases where a malicious user may control the input to the parser.
Definition at line 947 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getCleanSignatures | ( | ) |
Clean up signature texts?
Definition at line 554 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getCollapsibleSections | ( | ) |
Should section contents be wrapped in.
Definition at line 895 of file ParserOptions.php.
Referenced by MediaWiki\Parser\ParserOutput\setFromParserOptions().
| MediaWiki\Parser\ParserOptions::getCurrentRevisionRecordCallback | ( | ) |
Callback to fetch the current revision.
Definition at line 994 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getDateFormat | ( | ) |
| MediaWiki\Parser\ParserOptions::getDisableContentConversion | ( | ) |
Whether content conversion should be disabled.
Definition at line 591 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getDisableTitleConversion | ( | ) |
Whether title conversion should be disabled.
Definition at line 608 of file ParserOptions.php.
Referenced by MediaWiki\Parser\Parser\parse().
| MediaWiki\Parser\ParserOptions::getEnableImageWhitelist | ( | ) |
Use the on-wiki external image whitelist?
Definition at line 348 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getEnableLimitReport | ( | ) |
Enable limit report in an HTML comment on output
Definition at line 533 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getExpensiveParserFunctionLimit | ( | ) |
Maximum number of calls per parse to expensive parser functions.
Definition at line 493 of file ParserOptions.php.
Referenced by MediaWiki\Parser\Parser\makeLimitReport(), and MediaWiki\Parser\Parser\parse().
| MediaWiki\Parser\ParserOptions::getExternalLinkTarget | ( | ) |
Target attribute for external links.
Definition at line 573 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getInterfaceMessage | ( | ) |
Parsing an interface message in the user language?
Note: use isMessage() to determine if we are parsing a message in any language.
Definition at line 376 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getInterwikiMagic | ( | ) |
Whether to extract interlanguage links.
When true, interlanguage links will be returned by ParserOutput::getLanguageLinks() instead of generating link HTML.
Definition at line 312 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getIsPreview | ( | ) |
Parsing the page for a "preview" operation?
Definition at line 646 of file ParserOptions.php.
Referenced by MediaWiki\Parser\ParserOutput\setFromParserOptions().
| MediaWiki\Parser\ParserOptions::getIsPrintable | ( | ) |
Parsing the printable version of the page?
Definition at line 686 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getIsSectionPreview | ( | ) |
Parsing the page for a "preview" operation on a single section?
Definition at line 666 of file ParserOptions.php.
|
static |
Get lazy-loaded options.
This array should be initialised by the constructor. The return type hint is used as an assertion to ensure this has happened and to coerce the type for static analysis.
Definition at line 246 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getMagicISBNLinks | ( | ) |
Are magic ISBN links enabled?
Definition at line 819 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getMagicPMIDLinks | ( | ) |
Are magic PMID links enabled?
Definition at line 828 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getMagicRFCLinks | ( | ) |
Are magic RFC links enabled?
Definition at line 837 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getMaxIncludeSize | ( | ) |
Maximum size of template expansions, in bytes.
Definition at line 431 of file ParserOptions.php.
Referenced by MediaWiki\Parser\Parser\makeLimitReport().
| MediaWiki\Parser\ParserOptions::getMaxPPExpandDepth | ( | ) |
Maximum recursion depth in PPFrame::expand()
Definition at line 465 of file ParserOptions.php.
Referenced by MediaWiki\Parser\Parser\makeLimitReport().
| MediaWiki\Parser\ParserOptions::getMaxPPNodeCount | ( | ) |
Maximum number of nodes touched by PPFrame::expand()
Definition at line 448 of file ParserOptions.php.
Referenced by MediaWiki\Parser\Parser\makeLimitReport().
| MediaWiki\Parser\ParserOptions::getMaxTemplateDepth | ( | ) |
Maximum recursion depth for templates within templates.
Definition at line 474 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getOption | ( | $name | ) |
Fetch an option and track that is was accessed.
| string | $name | Option name |
Definition at line 206 of file ParserOptions.php.
Referenced by MediaWiki\Page\ParserOutputAccess\postprocessInPipeline().
| MediaWiki\Parser\ParserOptions::getPostproc | ( | ) |
Returns usage of postprocessing (and splits the cache accordingly)
Definition at line 1884 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getPreSaveTransform | ( | ) |
Transform wiki markup when saving the page?
Definition at line 703 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getRedirectTarget | ( | ) |
Get the previously-set redirect target.
Definition at line 1143 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getRemoveComments | ( | ) |
Remove HTML comments.
Definition at line 512 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getRenderReason | ( | ) |
Returns reason for rendering the content.
This human-readable, intended for logging and debugging only. Expected values include "edit", "view", "purge", "LinksUpdate", etc.
Definition at line 1866 of file ParserOptions.php.
Referenced by MediaWiki\Parser\RevisionOutputCache\save().
| MediaWiki\Parser\ParserOptions::getSpeculativePageId | ( | ) |
A guess for {{PAGEID}}, calculated using the callback provided via setSpeculativeRevPageCallback().
For consistency, the value will be calculated upon the first call of this method, and re-used for subsequent calls.
If no callback was defined via setSpeculativePageIdCallback(), this method will return false.
Definition at line 1051 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getSpeculativeRevId | ( | ) |
A guess for {{REVISIONID}}, calculated using the callback provided via setSpeculativeRevIdCallback().
For consistency, the value will be calculated upon the first call of this method, and re-used for subsequent calls.
If no callback was defined via setSpeculativeRevIdCallback(), this method will return false.
Definition at line 1037 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getSuppressSectionEditLinks | ( | ) |
Should section edit links be suppressed? Used when parsing wikitext which will be presented in a non-interactive context: previews, UX text, etc.
Definition at line 876 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getSuppressTOC | ( | ) |
Should the table of contents be suppressed? Used when parsing "code" pages (like JavaScript) as wikitext for backlink support and categories, but where we don't want other metadata generated (like the table of contents).
Definition at line 850 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getTargetLanguage | ( | ) |
Target language for the parse.
Definition at line 414 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getTemplateCallback | ( | ) |
Callback to fetch a template.
Definition at line 1014 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getThumbSize | ( | ) |
| MediaWiki\Parser\ParserOptions::getTimestamp | ( | ) |
Timestamp used for {{CURRENTDAY}} etc.
Definition at line 1109 of file ParserOptions.php.
References wfTimestampNow().
| MediaWiki\Parser\ParserOptions::getUseParsoid | ( | ) |
Parsoid-format HTML output, or legacy wikitext parser HTML?
Definition at line 723 of file ParserOptions.php.
Referenced by MediaWiki\Parser\ParserOutput\setFromParserOptions().
| MediaWiki\Parser\ParserOptions::getUserIdentity | ( | ) |
Get the identity of the user for whom the parse is made.
Definition at line 1162 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getUserLang | ( | ) |
Same as getUserLangObj() but returns a string instead.
Definition at line 797 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getUserLangObj | ( | ) |
Get the user language used by the parser for this page and split the parser cache.
Definition at line 781 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getVariant | ( | ) |
Returns the target language variant, or null if no language conversion is to be performed.
This is a postprocessing option, and has an effect on Parsoid parses only. null means LanguageConverter should be bypassed.
Definition at line 929 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::getWrapOutputClass | ( | ) |
Class to use to wrap output from Parser::parse()
Definition at line 968 of file ParserOptions.php.
Referenced by MediaWiki\Parser\ParserOutput\setFromParserOptions().
| MediaWiki\Parser\ParserOptions::isMessage | ( | ) |
Parsing a message?
Definition at line 395 of file ParserOptions.php.
Referenced by MediaWiki\Parser\Parser\makeLimitReport(), and MediaWiki\Parser\ParserOutput\setFromParserOptions().
| MediaWiki\Parser\ParserOptions::isSafeToCache | ( | ?array | $usedOptions = null | ) |
Test whether the set of provided options are safe to cache.
A set of options is safe to cache if it's composed of the following:
| string[] | null | $usedOptions | the list of options to check; typically the ones that are actually used in the parse. Defaults to all options. |
Definition at line 1721 of file ParserOptions.php.
Referenced by MediaWiki\Parser\RevisionOutputCache\save().
| MediaWiki\Parser\ParserOptions::matches | ( | ParserOptions | $other | ) |
Check if these options match that of another options set.
This ignores report limit settings that only affect HTML comments
| ParserOptions | $other |
Definition at line 1490 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::matchesForCacheKey | ( | ParserOptions | $other | ) |
| ParserOptions | $other |
Definition at line 1535 of file ParserOptions.php.
|
static |
Creates a "canonical" ParserOptions object.
For historical reasons, certain options may have default values that are different from the canonical values used for caching; this is done to avoid expiring the entirety of an existing ParserCache's contents in production when a default changes. See the discussion in ::getDefaults() for more details.
| IContextSource | string | UserIdentity | $context |
|
| Language | StubObject | null | $userLang | (see above) |
Definition at line 1262 of file ParserOptions.php.
|
static |
Get a ParserOptions object for an anonymous user.
Definition at line 1183 of file ParserOptions.php.
|
static |
Get a ParserOptions object from a IContextSource object.
| IContextSource | $context |
Definition at line 1219 of file ParserOptions.php.
References MediaWiki\Context\IContextSource\getLanguage(), MediaWiki\Context\IContextSource\getRequest(), and MediaWiki\Context\IContextSource\getUser().
Referenced by MediaWiki\Actions\RawAction\getRawText().
|
static |
Get a ParserOptions object from a given user.
Language will be taken from main request context.
| UserIdentity | $user |
Definition at line 1196 of file ParserOptions.php.
|
static |
Get a ParserOptions object from a given user and language.
| UserIdentity | $user | |
| Language | $lang |
Definition at line 1208 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::optionsHash | ( | $forOptions, | |
| $title = null ) |
Generate a hash string with the values set on these ParserOptions for the keys given in the array.
This will be used as part of the hash key for the parser cache, so users sharing the options with vary for the same page share the same cached data safely.
| string[] | $forOptions | |
| Title | null | $title | Used to get the content language of the page (since r97636) |
Definition at line 1645 of file ParserOptions.php.
Referenced by MediaWiki\Parser\ParserObserver\notifyParse().
| MediaWiki\Parser\ParserOptions::registerWatcher | ( | $callback | ) |
Registers a callback for tracking which ParserOptions which are used.
| callable | null | $callback | New callback |
Definition at line 1558 of file ParserOptions.php.
Referenced by MediaWiki\OutputTransform\OutputTransformPipeline\run().
| MediaWiki\Parser\ParserOptions::setAllowSpecialInclusion | ( | $x | ) |
Allow inclusion of special pages?
| bool | null | $x | New value (null is no change) |
Definition at line 365 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setAllowUnsafeRawHtml | ( | $x | ) |
If the wiki is configured to allow raw html ($wgRawHtml = true) is it allowed in the specific case of parsing this page.
| bool | null | $x | Value to set or null to get current value |
Definition at line 959 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setCleanSignatures | ( | $x | ) |
Clean up signature texts?
| bool | null | $x | New value (null is no change) |
Definition at line 564 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setCollapsibleSections | ( | ) |
Wrap section contents in a.
Definition at line 904 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setCurrentRevisionRecordCallback | ( | $x | ) |
Callback to fetch the current revision.
| callable | null | $x | New value |
Definition at line 1005 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setDateFormat | ( | $x | ) |
Date format index.
| string | null | $x | New value (null is no change) |
Definition at line 760 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setExpensiveParserFunctionLimit | ( | $x | ) |
Maximum number of calls per parse to expensive parser functions.
| int | null | $x | New value (null is no change) |
Definition at line 503 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setExternalLinkTarget | ( | $x | ) |
Target attribute for external links.
| string | false | null | $x | New value (null is no change) |
Definition at line 583 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setInterfaceMessage | ( | $x | ) |
Parsing an interface message in the user language?
| bool | null | $x | New value (null is no change) |
Definition at line 385 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setInterwikiMagic | ( | $x | ) |
Specify whether to extract interlanguage links.
| bool | null | $x | New value (null is no change) |
Definition at line 321 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setIsMessage | ( | $x | ) |
Set whether we are parsing a message.
| bool | $x |
Definition at line 406 of file ParserOptions.php.
Referenced by MediaWiki\Output\OutputPage\wrapWikiMsg().
| MediaWiki\Parser\ParserOptions::setIsPreview | ( | $x | ) |
Parsing the page for a "preview" operation?
| bool | null | $x | New value (null is no change) |
Definition at line 655 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setIsPrintable | ( | $x | ) |
Parsing the printable version of the page?
| bool | null | $x | New value (null is no change) |
Definition at line 695 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setIsSectionPreview | ( | $x | ) |
Parsing the page for a "preview" operation on a single section?
| bool | null | $x | New value (null is no change) |
Definition at line 675 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setMaxIncludeSize | ( | $x | ) |
Maximum size of template expansions, in bytes.
| int | null | $x | New value (null is no change) |
Definition at line 440 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setMaxPPNodeCount | ( | $x | ) |
Maximum number of nodes touched by PPFrame::expand()
| int | null | $x | New value (null is no change) |
Definition at line 457 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setMaxTemplateDepth | ( | $x | ) |
Maximum recursion depth for templates within templates.
| int | null | $x | New value (null is no change) |
Definition at line 484 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setOption | ( | $name, | |
| $value ) |
Set an option, generically.
| string | $name | Option name |
| mixed | $value | New value. Passing null will set null, unlike many of the existing accessors which ignore null for historical reasons. |
Definition at line 280 of file ParserOptions.php.
|
protected |
Legacy implementation.
| string | $name | Option name |
| mixed | $value | New value. Passing null does not set the value. |
Definition at line 297 of file ParserOptions.php.
References wfSetVar().
| MediaWiki\Parser\ParserOptions::setPreSaveTransform | ( | $x | ) |
Transform wiki markup when saving the page?
| bool | null | $x | New value (null is no change) |
Definition at line 712 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setRedirectTarget | ( | $title | ) |
Note that setting or changing this does not make the page a redirect or change its target, it merely records the information for reference during the parse.
| Title | null | $title |
Definition at line 1133 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setRemoveComments | ( | $x | ) |
Remove HTML comments.
| bool | null | $x | New value (null is no change) |
Definition at line 522 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setRenderReason | ( | string | $renderReason | ) |
Sets reason for rendering the content.
This human-readable, intended for logging and debugging only. Expected values include "edit", "view", "purge", "LinksUpdate", etc.
Definition at line 1874 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setSpeculativePageIdCallback | ( | $x | ) |
Callback to generate a guess for {{PAGEID}}.
| callable | null | $x | New value |
Definition at line 1100 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setSpeculativeRevIdCallback | ( | $x | ) |
Callback to generate a guess for {{REVISIONID}}.
| callable | null | $x | New value |
Definition at line 1089 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setSuppressSectionEditLinks | ( | ) |
Suppress section edit links in the output.
Used when parsing wikitext which will be presented in a non-interactive context: previews, UX text, etc.
Definition at line 886 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setSuppressTOC | ( | ) |
Suppress generation of the table of contents.
Used when parsing "code" pages (like JavaScript) as wikitext for backlink support and categories, but where we don't want other metadata generated (like the table of contents).
Definition at line 864 of file ParserOptions.php.
References wfDeprecated().
| MediaWiki\Parser\ParserOptions::setTargetLanguage | ( | $x | ) |
Target language for the parse.
| Language | null | $x | New value |
Definition at line 423 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setTemplateCallback | ( | $x | ) |
Set the callback to fetch a template.
| callable(ParsoidLinkTarget,Parser|false):array|null | $x New value (null is no change) |
Definition at line 1023 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setThumbSize | ( | $x | ) |
Thumb size preferred by the user.
This is currently ignored by the parser. It will be deprecated in future versions.
| int | null | $x | New value (null is no change) |
Definition at line 638 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setTimestamp | ( | $x | ) |
Timestamp used for {{CURRENTDAY}} etc.
| string | null | $x | New value (null is no change) |
Definition at line 1121 of file ParserOptions.php.
References wfSetVar().
| MediaWiki\Parser\ParserOptions::setupFakeRevision | ( | $page, | |
| $content, | |||
| $user, | |||
| $currentRevId = 0 ) |
Sets a hook to force that a page exists, and sets a current revision callback to return a revision with custom content when the current revision of the page is requested.
| PageIdentity | $page | |
| Content | $content | |
| UserIdentity | $user | The user that the fake revision is attributed to |
| int | $currentRevId |
Definition at line 1800 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setUseParsoid | ( | bool | $value = true | ) |
Request Parsoid-format HTML output.
Definition at line 733 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setUserLang | ( | $x | ) |
Set the user language used by the parser for this page and split the parser cache.
| string | Language | $x | New value |
Definition at line 806 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setVariant | ( | ?Language | $variantLanguage | ) |
Set the target language variant.
This is a postprocessing option, and has an effect on Parsoid parses only. null means LanguageConverter should be bypassed, so -{...}- constructs will not be filled in at all. Setting the variant to the base language will ensure that -{...}- constructs will be processed, even though no text conversion will occur.
Definition at line 918 of file ParserOptions.php.
| MediaWiki\Parser\ParserOptions::setWrapOutputClass | ( | $className | ) |
CSS class to use to wrap output from Parser::parse()
| string | $className | Class name to use for wrapping. Passing false to indicate "no wrapping" was deprecated in MediaWiki 1.31. |
Definition at line 979 of file ParserOptions.php.
References wfDeprecated().
|
static |
List of "postprocessing options", excluded from most ParserOption operations by default.
Definition at line 128 of file ParserOptions.php.