MediaWiki REL1_34
|
Set options of the Parser. More...
Public Member Functions | |
__construct ( $user=null, $lang=null) | |
addExtraKey ( $key) | |
Extra key that should be present in the parser cache key. | |
disableContentConversion ( $x=true) | |
Whether content conversion should be disabled. | |
disableTitleConversion ( $x=true) | |
Whether title conversion should be disabled. | |
enableLimitReport ( $x=true) | |
Enable limit report in an HTML comment on output. | |
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? | |
getCurrentRevisionCallback () | |
Callback for current revision fetching; first argument to call_user_func(). | |
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 () | |
Enable limit report in an HTML comment on output. | |
getExpensiveParserFunctionLimit () | |
Maximum number of calls per parse to expensive parser functions. | |
getExternalLinkTarget () | |
Target attribute for external links. | |
getInterfaceMessage () | |
Parsing an interface message? | |
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? | |
getMaxGeneratedPPNodeCount () | |
Maximum number of nodes generated by Preprocessor::preprocessToObj() | |
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. | |
getNumberHeadings () | |
Automatically number headings? | |
getOption ( $name) | |
Fetch an option and track that is was accessed. | |
getPreSaveTransform () | |
Transform wiki markup when saving the page? | |
getRedirectTarget () | |
Get the previously-set redirect target. | |
getRemoveComments () | |
Remove HTML comments. | |
getSpeculativePageId () | |
A guess for {{PAGEID}}, calculated using the callback provided via setSpeculativeRevPageCallback(). | |
getSpeculativeRevId () | |
A guess for {{REVISIONID}}, calculated using the callback provided via setSpeculativeRevIdCallback(). | |
getStubThreshold () | |
Thumb size preferred by the user. | |
getTargetLanguage () | |
Target language for the parse. | |
getTemplateCallback () | |
Callback for template fetching; first argument to call_user_func(). | |
getThumbSize () | |
Thumb size preferred by the user. | |
getTidy () | |
Use tidy to cleanup output HTML? | |
getTimestamp () | |
Timestamp used for {{CURRENTDAY}} etc. | |
getUser () | |
Current user. | |
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. | |
getWrapOutputClass () | |
Class to use to wrap output from Parser::parse() | |
isSafeToCache () | |
Test whether these 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. | |
optionUsed ( $optionName) | |
Called when an option is accessed. | |
registerWatcher ( $callback) | |
Registers a callback for tracking which ParserOptions which are used. | |
setAllowExternalImages ( $x) | |
Allow all external images inline? | |
setAllowExternalImagesFrom ( $x) | |
External images to allow. | |
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? | |
setCurrentRevisionCallback ( $x) | |
Callback for current revision fetching; first argument to call_user_func(). | |
setDateFormat ( $x) | |
Date format index. | |
setEnableImageWhitelist ( $x) | |
Use the on-wiki external image whitelist? | |
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? | |
setInterwikiMagic ( $x) | |
Specify whether to extract interlanguage links. | |
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? | |
setMaxGeneratedPPNodeCount ( $x) | |
Maximum number of nodes generated by Preprocessor::preprocessToObj() | |
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. | |
setNumberHeadings ( $x) | |
Automatically number headings? | |
setOption ( $name, $value) | |
Set an option, generically. | |
setPreSaveTransform ( $x) | |
Transform wiki markup when saving the page? | |
setRedirectTarget ( $title) | |
Set the redirect target. | |
setRemoveComments ( $x) | |
Remove HTML comments. | |
setSpeculativePageIdCallback ( $x) | |
Callback to generate a guess for {{PAGEID}}. | |
setSpeculativeRevIdCallback ( $x) | |
Callback to generate a guess for {{REVISIONID}}. | |
setStubThreshold ( $x) | |
Thumb size preferred by the user. | |
setTargetLanguage ( $x) | |
Target language for the parse. | |
setTemplateCallback ( $x) | |
Callback for template fetching; first argument to call_user_func(). | |
setThumbSize ( $x) | |
Thumb size preferred by the user. | |
setTidy ( $x) | |
Use tidy to cleanup output HTML? | |
setTimestamp ( $x) | |
Timestamp used for {{CURRENTDAY}} etc. | |
setupFakeRevision ( $title, $content, $user) | |
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. | |
setUserLang ( $x) | |
Set the user language used by the parser for this page and split the parser cache. | |
setWrapOutputClass ( $className) | |
CSS class to use to wrap output from Parser::parse() | |
Static Public Member Functions | |
static | allCacheVaryingOptions () |
Return all option keys that vary the options hash. | |
static | newCanonical ( $context=null, $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 (User $user, Language $lang) |
Get a ParserOptions object from a given user and language. | |
Public Attributes | |
const | HAS_NEWCANONICAL_FROM_CONTEXT = 1 |
Flag indicating that newCanonical() accepts an IContextSource or the string 'canonical', for back-compat checks from extensions. | |
Protected Member Functions | |
setOptionLegacy ( $name, $value) | |
Legacy implementation. | |
Private Member Functions | |
initialiseFromUser ( $user, $lang) | |
Get user options. | |
lazyLoadOption ( $name) | |
optionToString ( $value) | |
Convert an option to a string value. | |
Static Private Member Functions | |
static | getCanonicalOverrides () |
Get "canonical" non-default option values. | |
static | getDefaults () |
Get default option values. | |
static | initDateFormat (ParserOptions $popt) |
Lazy initializer for dateFormat. | |
static | initSpeculativePageId (ParserOptions $popt) |
Callback registered with ParserOptions::$lazyOptions, triggered by getSpeculativePageId(). | |
static | initSpeculativeRevId (ParserOptions $popt) |
Callback registered with ParserOptions::$lazyOptions, triggered by getSpeculativeRevId(). | |
Private Attributes | |
$mExtraKey = '' | |
Appended to the options hash. | |
string null | $mTimestamp |
Timestamp used for {{CURRENTDAY}} etc. | |
User | $mUser |
Stored user object. | |
callable null | $onAccessCallback = null |
Function to be called when an option is accessed. | |
array | $options |
Current values for all options that are relevant for caching. | |
Title null | $redirectTarget = null |
If the page being parsed is a redirect, this should hold the redirect target. | |
Static Private Attributes | |
static array null | $defaults = null |
Default values for all options that are relevant for caching. | |
static array | $inCacheKey |
Specify options that are included in the cache key. | |
static callable[] | $lazyOptions |
Lazy-loaded options. | |
Set options of the Parser.
How to add an option in core:
How to add an option in an extension:
Definition at line 42 of file ParserOptions.php.
ParserOptions::__construct | ( | $user = null, | |
$lang = null ) |
Definition at line 987 of file ParserOptions.php.
References $lang, $wgLang, and initialiseFromUser().
ParserOptions::addExtraKey | ( | $key | ) |
Extra key that should be present in the parser cache key.
string | $key |
Definition at line 969 of file ParserOptions.php.
|
static |
Return all option keys that vary the options hash.
Definition at line 1295 of file ParserOptions.php.
ParserOptions::disableContentConversion | ( | $x = true | ) |
Whether content conversion should be disabled.
bool | null | $x | New value (null is no change) |
Definition at line 523 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::disableTitleConversion | ( | $x = true | ) |
Whether title conversion should be disabled.
bool | null | $x | New value (null is no change) |
Definition at line 540 of file ParserOptions.php.
References setOptionLegacy().
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 470 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::getAllowExternalImages | ( | ) |
Allow all external images inline?
Definition at line 205 of file ParserOptions.php.
References getOption().
ParserOptions::getAllowExternalImagesFrom | ( | ) |
External images to allow.
When self::getAllowExternalImages() is false
Definition at line 225 of file ParserOptions.php.
References getOption().
ParserOptions::getAllowSpecialInclusion | ( | ) |
Allow inclusion of special pages?
Definition at line 279 of file ParserOptions.php.
References getOption().
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 763 of file ParserOptions.php.
References getOption().
|
staticprivate |
Get "canonical" non-default option values.
Definition at line 1177 of file ParserOptions.php.
References $wgEnableParserLimitReporting.
ParserOptions::getCleanSignatures | ( | ) |
Clean up signature texts?
Definition at line 479 of file ParserOptions.php.
References getOption().
ParserOptions::getCurrentRevisionCallback | ( | ) |
Callback for current revision fetching; first argument to call_user_func().
Definition at line 810 of file ParserOptions.php.
References getOption().
ParserOptions::getDateFormat | ( | ) |
Date format index.
Definition at line 650 of file ParserOptions.php.
References getOption().
|
staticprivate |
Get default option values.
Definition at line 1101 of file ParserOptions.php.
References $wgAllowExternalImages, $wgAllowExternalImagesFrom, $wgAllowSpecialInclusion, $wgCleanSignatures, $wgDisableLangConversion, $wgDisableTitleConversion, $wgEnableImageWhitelist, $wgEnableMagicLinks, $wgExpensiveParserFunctionLimit, $wgExternalLinkTarget, $wgInterwikiMagic, $wgMaxArticleSize, $wgMaxGeneratedPPNodeCount, $wgMaxPPExpandDepth, $wgMaxPPNodeCount, and $wgMaxTemplateDepth.
ParserOptions::getDisableContentConversion | ( | ) |
Whether content conversion should be disabled.
Definition at line 514 of file ParserOptions.php.
References getOption().
ParserOptions::getDisableTitleConversion | ( | ) |
Whether title conversion should be disabled.
Definition at line 531 of file ParserOptions.php.
References getOption().
Referenced by Parser\parse().
ParserOptions::getEnableImageWhitelist | ( | ) |
Use the on-wiki external image whitelist?
Definition at line 245 of file ParserOptions.php.
References getOption().
ParserOptions::getEnableLimitReport | ( | ) |
Enable limit report in an HTML comment on output.
Definition at line 461 of file ParserOptions.php.
References getOption().
ParserOptions::getExpensiveParserFunctionLimit | ( | ) |
Maximum number of calls per parse to expensive parser functions.
Definition at line 424 of file ParserOptions.php.
References getOption().
ParserOptions::getExternalLinkTarget | ( | ) |
Target attribute for external links.
Definition at line 497 of file ParserOptions.php.
References getOption().
ParserOptions::getInterfaceMessage | ( | ) |
Parsing an interface message?
Definition at line 313 of file ParserOptions.php.
References getOption().
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 188 of file ParserOptions.php.
References getOption().
ParserOptions::getIsPreview | ( | ) |
Parsing the page for a "preview" operation?
Definition at line 582 of file ParserOptions.php.
References getOption().
ParserOptions::getIsPrintable | ( | ) |
Parsing the printable version of the page?
Definition at line 616 of file ParserOptions.php.
References getOption().
ParserOptions::getIsSectionPreview | ( | ) |
Parsing the page for a "preview" operation on a single section?
Definition at line 599 of file ParserOptions.php.
References getOption().
ParserOptions::getMagicISBNLinks | ( | ) |
Are magic ISBN links enabled?
Definition at line 727 of file ParserOptions.php.
References getOption().
ParserOptions::getMagicPMIDLinks | ( | ) |
Are magic PMID links enabled?
Definition at line 736 of file ParserOptions.php.
References getOption().
ParserOptions::getMagicRFCLinks | ( | ) |
Are magic RFC links enabled?
Definition at line 745 of file ParserOptions.php.
References getOption().
ParserOptions::getMaxGeneratedPPNodeCount | ( | ) |
Maximum number of nodes generated by Preprocessor::preprocessToObj()
Definition at line 381 of file ParserOptions.php.
References getOption().
ParserOptions::getMaxIncludeSize | ( | ) |
Maximum size of template expansions, in bytes.
Definition at line 347 of file ParserOptions.php.
References getOption().
ParserOptions::getMaxPPExpandDepth | ( | ) |
Maximum recursion depth in PPFrame::expand()
Definition at line 398 of file ParserOptions.php.
References getOption().
ParserOptions::getMaxPPNodeCount | ( | ) |
Maximum number of nodes touched by PPFrame::expand()
Definition at line 364 of file ParserOptions.php.
References getOption().
ParserOptions::getMaxTemplateDepth | ( | ) |
Maximum recursion depth for templates within templates.
Definition at line 406 of file ParserOptions.php.
References getOption().
ParserOptions::getNumberHeadings | ( | ) |
Automatically number headings?
Definition at line 262 of file ParserOptions.php.
References getOption().
ParserOptions::getOption | ( | $name | ) |
Fetch an option and track that is was accessed.
string | $name | Option name |
Definition at line 127 of file ParserOptions.php.
References lazyLoadOption(), and optionUsed().
Referenced by getAllowExternalImages(), getAllowExternalImagesFrom(), getAllowSpecialInclusion(), getAllowUnsafeRawHtml(), getCleanSignatures(), getCurrentRevisionCallback(), getDateFormat(), getDisableContentConversion(), getDisableTitleConversion(), getEnableImageWhitelist(), getEnableLimitReport(), getExpensiveParserFunctionLimit(), getExternalLinkTarget(), getInterfaceMessage(), getInterwikiMagic(), getIsPreview(), getIsPrintable(), getIsSectionPreview(), getMagicISBNLinks(), getMagicPMIDLinks(), getMagicRFCLinks(), getMaxGeneratedPPNodeCount(), getMaxIncludeSize(), getMaxPPExpandDepth(), getMaxPPNodeCount(), getMaxTemplateDepth(), getNumberHeadings(), getPreSaveTransform(), getRemoveComments(), getSpeculativePageId(), getSpeculativeRevId(), getStubThreshold(), getTargetLanguage(), getTemplateCallback(), getThumbSize(), getTidy(), getUserLangObj(), getWrapOutputClass(), initSpeculativePageId(), and initSpeculativeRevId().
ParserOptions::getPreSaveTransform | ( | ) |
Transform wiki markup when saving the page?
Definition at line 633 of file ParserOptions.php.
References getOption().
Referenced by Parser\preSaveTransform().
ParserOptions::getRedirectTarget | ( | ) |
Get the previously-set redirect target.
Definition at line 959 of file ParserOptions.php.
ParserOptions::getRemoveComments | ( | ) |
Remove HTML comments.
Definition at line 443 of file ParserOptions.php.
References getOption().
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 865 of file ParserOptions.php.
References getOption().
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 851 of file ParserOptions.php.
References getOption().
ParserOptions::getStubThreshold | ( | ) |
Thumb size preferred by the user.
Definition at line 565 of file ParserOptions.php.
References getOption().
Referenced by WikiPage\getParserOutput(), and WikiPage\shouldCheckParserCache().
ParserOptions::getTargetLanguage | ( | ) |
Target language for the parse.
Definition at line 330 of file ParserOptions.php.
References getOption().
Referenced by ScribuntoContent\fillParserOutput().
ParserOptions::getTemplateCallback | ( | ) |
Callback for template fetching; first argument to call_user_func().
Definition at line 828 of file ParserOptions.php.
References getOption().
ParserOptions::getThumbSize | ( | ) |
Thumb size preferred by the user.
Definition at line 548 of file ParserOptions.php.
References getOption().
ParserOptions::getTidy | ( | ) |
Use tidy to cleanup output HTML?
Definition at line 296 of file ParserOptions.php.
References getOption().
ParserOptions::getTimestamp | ( | ) |
Timestamp used for {{CURRENTDAY}} etc.
Definition at line 923 of file ParserOptions.php.
References wfTimestampNow().
ParserOptions::getUser | ( | ) |
Current user.
Definition at line 977 of file ParserOptions.php.
Referenced by Parser\fuzzTestPst().
ParserOptions::getUserLang | ( | ) |
Same as getUserLangObj() but returns a string instead.
Definition at line 705 of file ParserOptions.php.
References getUserLangObj().
ParserOptions::getUserLangObj | ( | ) |
Get the user language used by the parser for this page and split the parser cache.
Definition at line 689 of file ParserOptions.php.
References getOption().
Referenced by getUserLang().
ParserOptions::getWrapOutputClass | ( | ) |
Class to use to wrap output from Parser::parse()
Definition at line 784 of file ParserOptions.php.
References getOption().
|
staticprivate |
Lazy initializer for dateFormat.
ParserOptions | $popt |
Definition at line 659 of file ParserOptions.php.
|
private |
Get user options.
Definition at line 1191 of file ParserOptions.php.
References $lang.
Referenced by __construct().
|
staticprivate |
Callback registered with ParserOptions::$lazyOptions, triggered by getSpeculativePageId().
ParserOptions | $popt |
Definition at line 889 of file ParserOptions.php.
References getOption().
|
staticprivate |
Callback registered with ParserOptions::$lazyOptions, triggered by getSpeculativeRevId().
ParserOptions | $popt |
Definition at line 875 of file ParserOptions.php.
References getOption().
ParserOptions::isSafeToCache | ( | ) |
Test whether these options are safe to cache.
Definition at line 1397 of file ParserOptions.php.
References $defaults, and optionToString().
Referenced by WikiPage\getParserOutput().
|
private |
string | $name | Lazy load option without tracking usage |
Definition at line 142 of file ParserOptions.php.
Referenced by getOption(), matches(), matchesForCacheKey(), and optionsHash().
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 1210 of file ParserOptions.php.
References lazyLoadOption(), and optionToString().
ParserOptions::matchesForCacheKey | ( | ParserOptions | $other | ) |
ParserOptions | $other |
Definition at line 1251 of file ParserOptions.php.
References lazyLoadOption(), and optionToString().
|
static |
Creates a "canonical" ParserOptions object.
For historical reasons, certain options have default values that are different from the canonical values used for caching.
IContextSource | string | User | null | $context |
|
Language | StubObject | null | $userLang | (see above) |
Definition at line 1073 of file ParserOptions.php.
References $context.
|
static |
Get a ParserOptions object for an anonymous user.
Definition at line 1013 of file ParserOptions.php.
|
static |
Get a ParserOptions object from a IContextSource object.
IContextSource | $context |
Definition at line 1052 of file ParserOptions.php.
References $context.
|
static |
Get a ParserOptions object from a given user.
Language will be taken from $wgLang.
User | $user |
Definition at line 1027 of file ParserOptions.php.
Get a ParserOptions object from a given user and language.
Definition at line 1040 of file ParserOptions.php.
References $lang.
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 1337 of file ParserOptions.php.
References $defaults, $title, $wgRenderHashAppend, getUser(), lazyLoadOption(), and optionToString().
Referenced by WikitextContent\fillParserOutput().
|
private |
Convert an option to a string value.
mixed | $value |
Definition at line 1309 of file ParserOptions.php.
Referenced by isSafeToCache(), matches(), matchesForCacheKey(), and optionsHash().
ParserOptions::optionUsed | ( | $optionName | ) |
Called when an option is accessed.
Calls the watcher that was set using registerWatcher(). Typically, the watcher callback is ParserOutput::registerOption(). The information registered that way will be used by ParserCache::save().
string | $optionName | Name of the option |
Definition at line 1284 of file ParserOptions.php.
Referenced by getOption().
ParserOptions::registerWatcher | ( | $callback | ) |
Registers a callback for tracking which ParserOptions which are used.
This is a private API with the parser.
callable | $callback |
Definition at line 1272 of file ParserOptions.php.
ParserOptions::setAllowExternalImages | ( | $x | ) |
Allow all external images inline?
bool | null | $x | New value (null is no change) |
Definition at line 214 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setAllowExternalImagesFrom | ( | $x | ) |
External images to allow.
When self::getAllowExternalImages() is false
string | string[] | null | $x | New value (null is no change) |
Definition at line 237 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setAllowSpecialInclusion | ( | $x | ) |
Allow inclusion of special pages?
bool | null | $x | New value (null is no change) |
Definition at line 288 of file ParserOptions.php.
References setOptionLegacy().
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 775 of file ParserOptions.php.
References setOptionLegacy().
Referenced by MessageCache\getParserOptions().
ParserOptions::setCleanSignatures | ( | $x | ) |
Clean up signature texts?
bool | null | $x | New value (null is no change) |
Definition at line 489 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setCurrentRevisionCallback | ( | $x | ) |
Callback for current revision fetching; first argument to call_user_func().
callable | null | $x | New value (null is no change) |
Definition at line 820 of file ParserOptions.php.
References setOptionLegacy().
Referenced by setupFakeRevision().
ParserOptions::setDateFormat | ( | $x | ) |
Date format index.
string | null | $x | New value (null is no change) |
Definition at line 668 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setEnableImageWhitelist | ( | $x | ) |
Use the on-wiki external image whitelist?
bool | null | $x | New value (null is no change) |
Definition at line 254 of file ParserOptions.php.
References setOptionLegacy().
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 434 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setExternalLinkTarget | ( | $x | ) |
Target attribute for external links.
string | null | $x | New value (null is no change) |
Definition at line 506 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setInterfaceMessage | ( | $x | ) |
Parsing an interface message?
bool | null | $x | New value (null is no change) |
Definition at line 322 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setInterwikiMagic | ( | $x | ) |
Specify whether to extract interlanguage links.
bool | null | $x | New value (null is no change) |
Definition at line 197 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setIsPreview | ( | $x | ) |
Parsing the page for a "preview" operation?
bool | null | $x | New value (null is no change) |
Definition at line 591 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setIsPrintable | ( | $x | ) |
Parsing the printable version of the page?
bool | null | $x | New value (null is no change) |
Definition at line 625 of file ParserOptions.php.
References setOptionLegacy().
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 608 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setMaxGeneratedPPNodeCount | ( | $x | ) |
Maximum number of nodes generated by Preprocessor::preprocessToObj()
int | null | $x | New value (null is no change) |
Definition at line 390 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setMaxIncludeSize | ( | $x | ) |
Maximum size of template expansions, in bytes.
int | null | $x | New value (null is no change) |
Definition at line 356 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setMaxPPNodeCount | ( | $x | ) |
Maximum number of nodes touched by PPFrame::expand()
int | null | $x | New value (null is no change) |
Definition at line 373 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setMaxTemplateDepth | ( | $x | ) |
Maximum recursion depth for templates within templates.
int | null | $x | New value (null is no change) |
Definition at line 415 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setNumberHeadings | ( | $x | ) |
Automatically number headings?
bool | null | $x | New value (null is no change) |
Definition at line 271 of file ParserOptions.php.
References setOptionLegacy().
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 156 of file ParserOptions.php.
Referenced by setSpeculativePageIdCallback(), setSpeculativeRevIdCallback(), setTargetLanguage(), and setWrapOutputClass().
|
protected |
Legacy implementation.
string | $name | Option name |
mixed | $value | New value. Passing null does not set the value. |
Definition at line 173 of file ParserOptions.php.
References wfSetVar().
Referenced by disableContentConversion(), disableTitleConversion(), enableLimitReport(), setAllowExternalImages(), setAllowExternalImagesFrom(), setAllowSpecialInclusion(), setAllowUnsafeRawHtml(), setCleanSignatures(), setCurrentRevisionCallback(), setDateFormat(), setEnableImageWhitelist(), setExpensiveParserFunctionLimit(), setExternalLinkTarget(), setInterfaceMessage(), setInterwikiMagic(), setIsPreview(), setIsPrintable(), setIsSectionPreview(), setMaxGeneratedPPNodeCount(), setMaxIncludeSize(), setMaxPPNodeCount(), setMaxTemplateDepth(), setNumberHeadings(), setPreSaveTransform(), setRemoveComments(), setStubThreshold(), setTemplateCallback(), setThumbSize(), setTidy(), and setUserLang().
ParserOptions::setPreSaveTransform | ( | $x | ) |
Transform wiki markup when saving the page?
bool | null | $x | New value (null is no change) |
Definition at line 642 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setRedirectTarget | ( | $title | ) |
Set the redirect target.
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 949 of file ParserOptions.php.
References $title.
ParserOptions::setRemoveComments | ( | $x | ) |
Remove HTML comments.
bool | null | $x | New value (null is no change) |
Definition at line 453 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setSpeculativePageIdCallback | ( | $x | ) |
Callback to generate a guess for {{PAGEID}}.
callable | null | $x | New value |
Definition at line 914 of file ParserOptions.php.
References setOption().
ParserOptions::setSpeculativeRevIdCallback | ( | $x | ) |
Callback to generate a guess for {{REVISIONID}}.
callable | null | $x | New value |
Definition at line 903 of file ParserOptions.php.
References setOption().
ParserOptions::setStubThreshold | ( | $x | ) |
Thumb size preferred by the user.
int | null | $x | New value (null is no change) |
Definition at line 574 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setTargetLanguage | ( | $x | ) |
Target language for the parse.
Language | null | $x | New value |
Definition at line 339 of file ParserOptions.php.
References setOption().
Referenced by ScribuntoContent\fillParserOutput().
ParserOptions::setTemplateCallback | ( | $x | ) |
Callback for template fetching; first argument to call_user_func().
callable | null | $x | New value (null is no change) |
Definition at line 837 of file ParserOptions.php.
References setOptionLegacy().
Referenced by getEngine(), and Scribunto_LuaEnvironmentComparisonTest\makeEngine().
ParserOptions::setThumbSize | ( | $x | ) |
Thumb size preferred by the user.
int | null | $x | New value (null is no change) |
Definition at line 557 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setTidy | ( | $x | ) |
Use tidy to cleanup output HTML?
bool | null | $x | New value (null is no change) |
Definition at line 305 of file ParserOptions.php.
References setOptionLegacy().
ParserOptions::setTimestamp | ( | $x | ) |
Timestamp used for {{CURRENTDAY}} etc.
string | null | $x | New value (null is no change) |
Definition at line 935 of file ParserOptions.php.
References wfSetVar().
ParserOptions::setupFakeRevision | ( | $title, | |
$content, | |||
$user ) |
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.
Definition at line 1421 of file ParserOptions.php.
References $content, $title, $wgHooks, and setCurrentRevisionCallback().
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 714 of file ParserOptions.php.
References setOptionLegacy().
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 795 of file ParserOptions.php.
References setOption(), and wfDeprecated().
|
staticprivate |
Default values for all options that are relevant for caching.
Definition at line 56 of file ParserOptions.php.
Referenced by isSafeToCache(), and optionsHash().
|
staticprivate |
Specify options that are included in the cache key.
Definition at line 72 of file ParserOptions.php.
|
staticprivate |
Lazy-loaded options.
Definition at line 62 of file ParserOptions.php.
|
private |
Appended to the options hash.
Definition at line 119 of file ParserOptions.php.
|
private |
Timestamp used for {{CURRENTDAY}} etc.
Definition at line 92 of file ParserOptions.php.
|
private |
Stored user object.
Definition at line 99 of file ParserOptions.php.
|
private |
Function to be called when an option is accessed.
Definition at line 106 of file ParserOptions.php.
|
private |
Current values for all options that are relevant for caching.
Definition at line 85 of file ParserOptions.php.
|
private |
If the page being parsed is a redirect, this should hold the redirect target.
Definition at line 114 of file ParserOptions.php.
const ParserOptions::HAS_NEWCANONICAL_FROM_CONTEXT = 1 |
Flag indicating that newCanonical() accepts an IContextSource or the string 'canonical', for back-compat checks from extensions.
Definition at line 49 of file ParserOptions.php.