MediaWiki  1.29.1
ParserOptions Class Reference

Set options of the Parser. More...

Collaboration diagram for ParserOptions:

Public Member Functions

 __construct ( $user=null, $lang=null)
 Constructor. More...
 
 addExtraKey ( $key)
 Extra key that should be present in the parser cache key. More...
 
 disableContentConversion ( $x=true)
 
 disableTitleConversion ( $x=true)
 
 enableLimitReport ( $x=true)
 
 getAllowExternalImages ()
 
 getAllowExternalImagesFrom ()
 
 getAllowSpecialInclusion ()
 
 getAllowUnsafeRawHtml ()
 
 getCleanSignatures ()
 
 getCurrentRevisionCallback ()
 
 getDateFormat ()
 
 getDisableContentConversion ()
 
 getDisableTitleConversion ()
 
 getEditSection ()
 
 getEnableImageWhitelist ()
 
 getEnableLimitReport ()
 
 getExpensiveParserFunctionLimit ()
 
 getExternalLinkTarget ()
 
 getInterfaceMessage ()
 
 getInterwikiMagic ()
 
 getIsPreview ()
 
 getIsPrintable ()
 
 getIsSectionPreview ()
 
 getMagicISBNLinks ()
 
 getMagicPMIDLinks ()
 
 getMagicRFCLinks ()
 
 getMaxGeneratedPPNodeCount ()
 
 getMaxIncludeSize ()
 
 getMaxPPExpandDepth ()
 
 getMaxPPNodeCount ()
 
 getMaxTemplateDepth ()
 
 getNumberHeadings ()
 
 getPreSaveTransform ()
 
 getRedirectTarget ()
 Get the previously-set redirect target. More...
 
 getRemoveComments ()
 
 getSpeculativeRevIdCallback ()
 
 getStubThreshold ()
 
 getTargetLanguage ()
 
 getTemplateCallback ()
 
 getThumbSize ()
 
 getTidy ()
 
 getTimestamp ()
 
 getUser ()
 
 getUserLang ()
 Same as getUserLangObj() but returns a string instead. More...
 
 getUserLangObj ()
 Get the user language used by the parser for this page and split the parser cache. More...
 
 matches (ParserOptions $other)
 Check if these options match that of another options set. More...
 
 optionsHash ( $forOptions, $title=null)
 Generate a hash string with the values set on these ParserOptions for the keys given in the array. More...
 
 optionUsed ( $optionName)
 Called when an option is accessed. More...
 
 registerWatcher ( $callback)
 Registers a callback for tracking which ParserOptions which are used. More...
 
 setAllowExternalImages ( $x)
 
 setAllowExternalImagesFrom ( $x)
 
 setAllowSpecialInclusion ( $x)
 
 setAllowUnsafeRawHtml ( $x)
 
 setCleanSignatures ( $x)
 
 setCurrentRevisionCallback ( $x)
 
 setDateFormat ( $x)
 
 setEditSection ( $x)
 
 setEnableImageWhitelist ( $x)
 
 setExpensiveParserFunctionLimit ( $x)
 
 setExternalLinkTarget ( $x)
 
 setInterfaceMessage ( $x)
 
 setInterwikiMagic ( $x)
 
 setIsPreview ( $x)
 
 setIsPrintable ( $x)
 
 setIsSectionPreview ( $x)
 
 setMaxGeneratedPPNodeCount ( $x)
 
 setMaxIncludeSize ( $x)
 
 setMaxPPNodeCount ( $x)
 
 setMaxTemplateDepth ( $x)
 
 setNumberHeadings ( $x)
 
 setPreSaveTransform ( $x)
 
 setRedirectTarget ( $title)
 Set the redirect target. More...
 
 setRemoveComments ( $x)
 
 setSpeculativeRevIdCallback ( $x)
 
 setStubThreshold ( $x)
 
 setTargetLanguage ( $x)
 
 setTemplateCallback ( $x)
 
 setThumbSize ( $x)
 
 setTidy ( $x)
 
 setTimestamp ( $x)
 
 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. More...
 
 setUserLang ( $x)
 

Static Public Member Functions

static legacyOptions ()
 Returns the full array of options that would have been used by in 1.16. More...
 
static newFromAnon ()
 Get a ParserOptions object for an anonymous user. More...
 
static newFromContext (IContextSource $context)
 Get a ParserOptions object from a IContextSource object. More...
 
static newFromUser ( $user)
 Get a ParserOptions object from a given user. More...
 
static newFromUserAndLang (User $user, Language $lang)
 Get a ParserOptions object from a given user and language. More...
 

Private Member Functions

 initialiseFromUser ( $user, $lang)
 Get user options. More...
 

Private Attributes

boolean $allowUnsafeRawHtml = true
 If the wiki is configured to allow raw html ($wgRawHtml = true) is it allowed in the specific case of parsing this page. More...
 
 $mAllowExternalImages
 Allow external images inline? More...
 
 $mAllowExternalImagesFrom
 If not, any exception? More...
 
 $mAllowSpecialInclusion
 Allow inclusion of special pages? More...
 
 $mCleanSignatures
 Clean up signature texts? More...
 
callable $mCurrentRevisionCallback
 Callback for current revision fetching; first argument to call_user_func(). More...
 
 $mDateFormat = null
 Date format index. More...
 
 $mDisableContentConversion
 Whether content conversion should be disabled. More...
 
 $mDisableTitleConversion
 Whether title conversion should be disabled. More...
 
 $mEditSection = true
 Create "edit section" links? More...
 
 $mEnableImageWhitelist
 If not or it doesn't match, should we check an on-wiki whitelist? More...
 
 $mEnableLimitReport = false
 Enable limit report in an HTML comment on output. More...
 
 $mExpensiveParserFunctionLimit
 Maximum number of calls per parse to expensive parser functions. More...
 
 $mExternalLinkTarget
 Target attribute for external links. More...
 
 $mExtraKey = ''
 Extra key that should be present in the caching key. More...
 
 $mInterfaceMessage = false
 Which lang to call for PLURAL and GRAMMAR. More...
 
 $mInterwikiMagic
 Interlanguage links are removed and returned in an array. More...
 
 $mIsPreview = false
 Parsing the page for a "preview" operation? More...
 
 $mIsPrintable = false
 Parsing the printable version of the page? More...
 
 $mIsSectionPreview = false
 Parsing the page for a "preview" operation on a single section? More...
 
 $mMagicISBNLinks = true
 Are magic ISBN links enabled? More...
 
 $mMagicPMIDLinks = true
 Are magic PMID links enabled? More...
 
 $mMagicRFCLinks = true
 Are magic RFC links enabled? More...
 
 $mMaxGeneratedPPNodeCount
 Maximum number of nodes generated by Preprocessor::preprocessToObj() More...
 
 $mMaxIncludeSize
 Maximum size of template expansions, in bytes. More...
 
 $mMaxPPExpandDepth
 Maximum recursion depth in PPFrame::expand() More...
 
 $mMaxPPNodeCount
 Maximum number of nodes touched by PPFrame::expand() More...
 
 $mMaxTemplateDepth
 Maximum recursion depth for templates within templates. More...
 
 $mNumberHeadings
 Automatically number headings? More...
 
 $mPreSaveTransform = true
 Transform wiki markup when saving the page? More...
 
 $mRemoveComments = true
 Remove HTML comments. More...
 
callable null $mSpeculativeRevIdCallback
 Callback to generate a guess for {{REVISIONID}}. More...
 
 $mStubThreshold
 Maximum article size of an article to be marked as "stub". More...
 
 $mTargetLanguage = null
 Overrides $mInterfaceMessage with arbitrary language. More...
 
callable $mTemplateCallback
 Callback for template fetching; first argument to call_user_func(). More...
 
 $mThumbSize
 Thumb size preferred by the user. More...
 
 $mTidy = false
 Use tidy to cleanup output HTML? More...
 
 $mTimestamp
 Timestamp used for {{CURRENTDAY}} etc. More...
 
User $mUser
 Stored user object. More...
 
 $mUserLang
 Language object of the User language. More...
 
 $onAccessCallback = null
 Function to be called when an option is accessed. More...
 
Title null $redirectTarget = null
 If the page being parsed is a redirect, this should hold the redirect target. More...
 

Detailed Description

Set options of the Parser.

All member variables are supposed to be private in theory, although in practice this is not the case.

Definition at line 33 of file ParserOptions.php.

Constructor & Destructor Documentation

◆ __construct()

ParserOptions::__construct (   $user = null,
  $lang = null 
)

Constructor.

Parameters
User$user
Language$lang

Definition at line 669 of file ParserOptions.php.

References $lang, $user, $wgLang, $wgUser, global, initialiseFromUser(), StubObject\isRealObject(), and User.

Member Function Documentation

◆ addExtraKey()

ParserOptions::addExtraKey (   $key)

Extra key that should be present in the parser cache key.

Parameters
string$key

Definition at line 660 of file ParserOptions.php.

◆ disableContentConversion()

ParserOptions::disableContentConversion (   $x = true)

Definition at line 583 of file ParserOptions.php.

References wfSetVar().

◆ disableTitleConversion()

ParserOptions::disableTitleConversion (   $x = true)

Definition at line 587 of file ParserOptions.php.

References wfSetVar().

◆ enableLimitReport()

ParserOptions::enableLimitReport (   $x = true)

Definition at line 567 of file ParserOptions.php.

References wfSetVar().

◆ getAllowExternalImages()

ParserOptions::getAllowExternalImages ( )

Definition at line 265 of file ParserOptions.php.

References $mAllowExternalImages.

◆ getAllowExternalImagesFrom()

ParserOptions::getAllowExternalImagesFrom ( )

Definition at line 269 of file ParserOptions.php.

References $mAllowExternalImagesFrom.

◆ getAllowSpecialInclusion()

ParserOptions::getAllowSpecialInclusion ( )

Definition at line 287 of file ParserOptions.php.

References $mAllowSpecialInclusion.

◆ getAllowUnsafeRawHtml()

ParserOptions::getAllowUnsafeRawHtml ( )
Since
1.29
Returns
bool

Definition at line 480 of file ParserOptions.php.

References $allowUnsafeRawHtml.

◆ getCleanSignatures()

ParserOptions::getCleanSignatures ( )

Definition at line 350 of file ParserOptions.php.

References $mCleanSignatures.

◆ getCurrentRevisionCallback()

ParserOptions::getCurrentRevisionCallback ( )

Definition at line 333 of file ParserOptions.php.

References $mCurrentRevisionCallback.

◆ getDateFormat()

ParserOptions::getDateFormat ( )

Definition at line 400 of file ParserOptions.php.

References $mDateFormat, and optionUsed().

Referenced by matches(), and optionsHash().

◆ getDisableContentConversion()

ParserOptions::getDisableContentConversion ( )

Definition at line 358 of file ParserOptions.php.

References $mDisableContentConversion.

◆ getDisableTitleConversion()

ParserOptions::getDisableTitleConversion ( )

Definition at line 362 of file ParserOptions.php.

References $mDisableTitleConversion.

◆ getEditSection()

ParserOptions::getEditSection ( )

Definition at line 277 of file ParserOptions.php.

References $mEditSection.

◆ getEnableImageWhitelist()

ParserOptions::getEnableImageWhitelist ( )

Definition at line 273 of file ParserOptions.php.

References $mEnableImageWhitelist.

◆ getEnableLimitReport()

ParserOptions::getEnableLimitReport ( )

Definition at line 346 of file ParserOptions.php.

References $mEnableLimitReport.

◆ getExpensiveParserFunctionLimit()

ParserOptions::getExpensiveParserFunctionLimit ( )

Definition at line 324 of file ParserOptions.php.

References $mExpensiveParserFunctionLimit.

◆ getExternalLinkTarget()

ParserOptions::getExternalLinkTarget ( )

Definition at line 354 of file ParserOptions.php.

References $mExternalLinkTarget.

◆ getInterfaceMessage()

ParserOptions::getInterfaceMessage ( )

Definition at line 295 of file ParserOptions.php.

References $mInterfaceMessage.

◆ getInterwikiMagic()

ParserOptions::getInterwikiMagic ( )

Definition at line 261 of file ParserOptions.php.

References $mInterwikiMagic.

◆ getIsPreview()

ParserOptions::getIsPreview ( )

Definition at line 378 of file ParserOptions.php.

References $mIsPreview.

◆ getIsPrintable()

ParserOptions::getIsPrintable ( )

Definition at line 386 of file ParserOptions.php.

References $mIsPrintable, and optionUsed().

◆ getIsSectionPreview()

ParserOptions::getIsSectionPreview ( )

Definition at line 382 of file ParserOptions.php.

References $mIsSectionPreview.

◆ getMagicISBNLinks()

ParserOptions::getMagicISBNLinks ( )
Since
1.28
Returns
bool

Definition at line 457 of file ParserOptions.php.

References $mMagicISBNLinks.

◆ getMagicPMIDLinks()

ParserOptions::getMagicPMIDLinks ( )
Since
1.28
Returns
bool

Definition at line 465 of file ParserOptions.php.

References $mMagicPMIDLinks.

◆ getMagicRFCLinks()

ParserOptions::getMagicRFCLinks ( )
Since
1.28
Returns
bool

Definition at line 472 of file ParserOptions.php.

References $mMagicRFCLinks.

◆ getMaxGeneratedPPNodeCount()

ParserOptions::getMaxGeneratedPPNodeCount ( )

Definition at line 311 of file ParserOptions.php.

References $mMaxGeneratedPPNodeCount.

◆ getMaxIncludeSize()

ParserOptions::getMaxIncludeSize ( )

Definition at line 303 of file ParserOptions.php.

References $mMaxIncludeSize.

◆ getMaxPPExpandDepth()

ParserOptions::getMaxPPExpandDepth ( )

Definition at line 315 of file ParserOptions.php.

References $mMaxPPExpandDepth.

◆ getMaxPPNodeCount()

ParserOptions::getMaxPPNodeCount ( )

Definition at line 307 of file ParserOptions.php.

References $mMaxPPNodeCount.

◆ getMaxTemplateDepth()

ParserOptions::getMaxTemplateDepth ( )

Definition at line 319 of file ParserOptions.php.

References $mMaxTemplateDepth.

◆ getNumberHeadings()

ParserOptions::getNumberHeadings ( )

Definition at line 281 of file ParserOptions.php.

References $mNumberHeadings, and optionUsed().

◆ getPreSaveTransform()

ParserOptions::getPreSaveTransform ( )

Definition at line 396 of file ParserOptions.php.

References $mPreSaveTransform.

◆ getRedirectTarget()

ParserOptions::getRedirectTarget ( )

Get the previously-set redirect target.

Since
1.24
Returns
Title|null

Definition at line 652 of file ParserOptions.php.

References $redirectTarget.

◆ getRemoveComments()

ParserOptions::getRemoveComments ( )

Definition at line 328 of file ParserOptions.php.

References $mRemoveComments.

◆ getSpeculativeRevIdCallback()

ParserOptions::getSpeculativeRevIdCallback ( )
Since
1.28

Definition at line 342 of file ParserOptions.php.

References $mSpeculativeRevIdCallback.

◆ getStubThreshold()

ParserOptions::getStubThreshold ( )

Definition at line 372 of file ParserOptions.php.

References $mStubThreshold, and optionUsed().

Referenced by WikiPage\getParserOutput(), and WikiPage\shouldCheckParserCache().

◆ getTargetLanguage()

ParserOptions::getTargetLanguage ( )

Definition at line 299 of file ParserOptions.php.

References $mTargetLanguage.

◆ getTemplateCallback()

ParserOptions::getTemplateCallback ( )

Definition at line 337 of file ParserOptions.php.

References $mTemplateCallback.

◆ getThumbSize()

ParserOptions::getThumbSize ( )

Definition at line 366 of file ParserOptions.php.

References $mThumbSize, and optionUsed().

◆ getTidy()

ParserOptions::getTidy ( )

Definition at line 291 of file ParserOptions.php.

References $mTidy.

◆ getTimestamp()

ParserOptions::getTimestamp ( )

Definition at line 408 of file ParserOptions.php.

References $mTimestamp, and wfTimestampNow().

◆ getUser()

ParserOptions::getUser ( )

Definition at line 392 of file ParserOptions.php.

References $mUser.

Referenced by optionsHash().

◆ getUserLang()

ParserOptions::getUserLang ( )

Same as getUserLangObj() but returns a string instead.

Warning
: Calling this causes the parser cache to be fragmented by user language! To avoid cache fragmentation, output should not depend on the user language. Use Parser::getFunctionLang() or Parser::getTargetLanguage() instead!
See also
getUserLangObj()
Returns
string Language code
Since
1.17

Definition at line 449 of file ParserOptions.php.

References getUserLangObj().

◆ getUserLangObj()

ParserOptions::getUserLangObj ( )

Get the user language used by the parser for this page and split the parser cache.

Warning
: Calling this causes the parser cache to be fragmented by user language! To avoid cache fragmentation, output should not depend on the user language. Use Parser::getFunctionLang() or Parser::getTargetLanguage() instead!
Note
This function will trigger a cache fragmentation by recording the 'userlang' option, see optionUsed(). This is done to avoid cache pollution when the page is rendered based on the language of the user.
When saving, this will return the default language instead of the user's. {{int: }} uses this which used to produce inconsistent link tables (T16404).
Returns
Language
Since
1.19

Definition at line 432 of file ParserOptions.php.

References $mUserLang, and optionUsed().

Referenced by getUserLang().

◆ initialiseFromUser()

ParserOptions::initialiseFromUser (   $user,
  $lang 
)
private

Get user options.

Parameters
User$user
Language$lang

Definition at line 736 of file ParserOptions.php.

References $lang, $user, $wgInterwikiMagic, $wgMaxArticleSize, and global.

Referenced by __construct().

◆ legacyOptions()

static ParserOptions::legacyOptions ( )
static

Returns the full array of options that would have been used by in 1.16.

Used to get the old parser cache entries when available.

Returns
array

Definition at line 827 of file ParserOptions.php.

Referenced by ParserCache\getETag(), and ParserCache\getKey().

◆ matches()

ParserOptions::matches ( ParserOptions  $other)

Check if these options match that of another options set.

This ignores report limit settings that only affect HTML comments

Parameters
ParserOptions$other
Returns
bool
Since
1.25

Definition at line 780 of file ParserOptions.php.

References as, and getDateFormat().

◆ newFromAnon()

static ParserOptions::newFromAnon ( )
static

Get a ParserOptions object for an anonymous user.

Since
1.27
Returns
ParserOptions

Definition at line 693 of file ParserOptions.php.

References $wgContLang, and global.

Referenced by MessageCache\getParserOptions(), and OutputPage\parserOptions().

◆ newFromContext()

◆ newFromUser()

◆ newFromUserAndLang()

◆ optionsHash()

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.

Extensions which require it should install 'PageRenderingHash' hook, which will give them a chance to modify this key based on their own settings.

Since
1.17
Parameters
array$forOptions
Title$titleUsed to get the content language of the page (since r97636)
Returns
string Page rendering hash

Definition at line 854 of file ParserOptions.php.

References $mExtraKey, $mStubThreshold, $mThumbSize, $title, $wgContLang, $wgRenderHashAppend, getDateFormat(), getUser(), global, and Hooks\run().

◆ optionUsed()

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().

Parameters
string$optionNameName of the option

Definition at line 815 of file ParserOptions.php.

Referenced by getDateFormat(), getIsPrintable(), getNumberHeadings(), getStubThreshold(), getThumbSize(), and getUserLangObj().

◆ registerWatcher()

ParserOptions::registerWatcher (   $callback)

Registers a callback for tracking which ParserOptions which are used.

This is a private API with the parser.

Parameters
callable$callback

Definition at line 803 of file ParserOptions.php.

◆ setAllowExternalImages()

ParserOptions::setAllowExternalImages (   $x)

Definition at line 488 of file ParserOptions.php.

References wfSetVar().

◆ setAllowExternalImagesFrom()

ParserOptions::setAllowExternalImagesFrom (   $x)

Definition at line 492 of file ParserOptions.php.

References wfSetVar().

◆ setAllowSpecialInclusion()

ParserOptions::setAllowSpecialInclusion (   $x)

Definition at line 512 of file ParserOptions.php.

References wfSetVar().

◆ setAllowUnsafeRawHtml()

ParserOptions::setAllowUnsafeRawHtml (   $x)
Parameters
bool|nullValue to set or null to get current value
Returns
bool Current value for allowUnsafeRawHtml
Since
1.29

Definition at line 628 of file ParserOptions.php.

References wfSetVar().

◆ setCleanSignatures()

ParserOptions::setCleanSignatures (   $x)

Definition at line 575 of file ParserOptions.php.

References wfSetVar().

◆ setCurrentRevisionCallback()

ParserOptions::setCurrentRevisionCallback (   $x)

Definition at line 554 of file ParserOptions.php.

References wfSetVar().

Referenced by setupFakeRevision().

◆ setDateFormat()

ParserOptions::setDateFormat (   $x)

Definition at line 500 of file ParserOptions.php.

References wfSetVar().

◆ setEditSection()

ParserOptions::setEditSection (   $x)

Definition at line 504 of file ParserOptions.php.

References wfSetVar().

Referenced by MessageCache\getParserOptions().

◆ setEnableImageWhitelist()

ParserOptions::setEnableImageWhitelist (   $x)

Definition at line 496 of file ParserOptions.php.

References wfSetVar().

◆ setExpensiveParserFunctionLimit()

ParserOptions::setExpensiveParserFunctionLimit (   $x)

Definition at line 545 of file ParserOptions.php.

References wfSetVar().

◆ setExternalLinkTarget()

ParserOptions::setExternalLinkTarget (   $x)

Definition at line 579 of file ParserOptions.php.

References wfSetVar().

◆ setInterfaceMessage()

ParserOptions::setInterfaceMessage (   $x)

Definition at line 520 of file ParserOptions.php.

References wfSetVar().

◆ setInterwikiMagic()

ParserOptions::setInterwikiMagic (   $x)

Definition at line 484 of file ParserOptions.php.

References wfSetVar().

◆ setIsPreview()

ParserOptions::setIsPreview (   $x)

Definition at line 611 of file ParserOptions.php.

References wfSetVar().

◆ setIsPrintable()

ParserOptions::setIsPrintable (   $x)

Definition at line 619 of file ParserOptions.php.

References wfSetVar().

◆ setIsSectionPreview()

ParserOptions::setIsSectionPreview (   $x)

Definition at line 615 of file ParserOptions.php.

References wfSetVar().

◆ setMaxGeneratedPPNodeCount()

ParserOptions::setMaxGeneratedPPNodeCount (   $x)

Definition at line 536 of file ParserOptions.php.

References wfSetVar().

◆ setMaxIncludeSize()

ParserOptions::setMaxIncludeSize (   $x)

Definition at line 528 of file ParserOptions.php.

References wfSetVar().

◆ setMaxPPNodeCount()

ParserOptions::setMaxPPNodeCount (   $x)

Definition at line 532 of file ParserOptions.php.

References wfSetVar().

◆ setMaxTemplateDepth()

ParserOptions::setMaxTemplateDepth (   $x)

Definition at line 540 of file ParserOptions.php.

References wfSetVar().

◆ setNumberHeadings()

ParserOptions::setNumberHeadings (   $x)

Definition at line 508 of file ParserOptions.php.

References wfSetVar().

◆ setPreSaveTransform()

ParserOptions::setPreSaveTransform (   $x)

Definition at line 607 of file ParserOptions.php.

References wfSetVar().

◆ setRedirectTarget()

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.

Since
1.24
Parameters
Title | null$title

Definition at line 642 of file ParserOptions.php.

References $title.

◆ setRemoveComments()

ParserOptions::setRemoveComments (   $x)

Definition at line 549 of file ParserOptions.php.

References wfSetVar().

◆ setSpeculativeRevIdCallback()

ParserOptions::setSpeculativeRevIdCallback (   $x)
Since
1.28

Definition at line 559 of file ParserOptions.php.

References wfSetVar().

◆ setStubThreshold()

ParserOptions::setStubThreshold (   $x)

Definition at line 603 of file ParserOptions.php.

References wfSetVar().

◆ setTargetLanguage()

ParserOptions::setTargetLanguage (   $x)

Definition at line 524 of file ParserOptions.php.

References wfSetVar().

◆ setTemplateCallback()

ParserOptions::setTemplateCallback (   $x)

Definition at line 563 of file ParserOptions.php.

References wfSetVar().

◆ setThumbSize()

ParserOptions::setThumbSize (   $x)

Definition at line 599 of file ParserOptions.php.

References wfSetVar().

◆ setTidy()

ParserOptions::setTidy (   $x)

Definition at line 516 of file ParserOptions.php.

References wfSetVar().

◆ setTimestamp()

ParserOptions::setTimestamp (   $x)

Definition at line 571 of file ParserOptions.php.

References wfSetVar().

◆ setupFakeRevision()

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.

Since
1.25
Parameters
Title$title
Content$content
User$userThe user that the fake revision is attributed to
Returns
ScopedCallback to unset the hook

Definition at line 942 of file ParserOptions.php.

References $content, $parser, $title, $user, $wgHooks, global, key, setCurrentRevisionCallback(), LinkCache\singleton(), and use.

◆ setUserLang()

ParserOptions::setUserLang (   $x)

Definition at line 591 of file ParserOptions.php.

References Language\factory(), and wfSetVar().

Member Data Documentation

◆ $allowUnsafeRawHtml

boolean ParserOptions::$allowUnsafeRawHtml = true
private

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.

Note
This is expected to be true for normal pages even if the wiki has $wgRawHtml disabled in general. The setting only signifies that raw html would be unsafe in the current context provided that raw html is allowed at all.

Definition at line 259 of file ParserOptions.php.

Referenced by getAllowUnsafeRawHtml().

◆ $mAllowExternalImages

ParserOptions::$mAllowExternalImages
private

Allow external images inline?

Definition at line 43 of file ParserOptions.php.

Referenced by getAllowExternalImages().

◆ $mAllowExternalImagesFrom

ParserOptions::$mAllowExternalImagesFrom
private

If not, any exception?

Definition at line 48 of file ParserOptions.php.

Referenced by getAllowExternalImagesFrom().

◆ $mAllowSpecialInclusion

ParserOptions::$mAllowSpecialInclusion
private

Allow inclusion of special pages?

Definition at line 68 of file ParserOptions.php.

Referenced by getAllowSpecialInclusion().

◆ $mCleanSignatures

ParserOptions::$mCleanSignatures
private

Clean up signature texts?

See also
Parser::cleanSig

Definition at line 156 of file ParserOptions.php.

Referenced by getCleanSignatures().

◆ $mCurrentRevisionCallback

callable ParserOptions::$mCurrentRevisionCallback
private
Initial value:
=
[ 'Parser', 'statelessFetchRevision' ]

Callback for current revision fetching; first argument to call_user_func().

Definition at line 123 of file ParserOptions.php.

Referenced by getCurrentRevisionCallback().

◆ $mDateFormat

ParserOptions::$mDateFormat = null
private

Date format index.

Definition at line 58 of file ParserOptions.php.

Referenced by getDateFormat().

◆ $mDisableContentConversion

ParserOptions::$mDisableContentConversion
private

Whether content conversion should be disabled.

Definition at line 166 of file ParserOptions.php.

Referenced by getDisableContentConversion().

◆ $mDisableTitleConversion

ParserOptions::$mDisableTitleConversion
private

Whether title conversion should be disabled.

Definition at line 171 of file ParserOptions.php.

Referenced by getDisableTitleConversion().

◆ $mEditSection

ParserOptions::$mEditSection = true
private

Create "edit section" links?

Definition at line 63 of file ParserOptions.php.

Referenced by getEditSection().

◆ $mEnableImageWhitelist

ParserOptions::$mEnableImageWhitelist
private

If not or it doesn't match, should we check an on-wiki whitelist?

Definition at line 53 of file ParserOptions.php.

Referenced by getEnableImageWhitelist().

◆ $mEnableLimitReport

ParserOptions::$mEnableLimitReport = false
private

Enable limit report in an HTML comment on output.

Definition at line 140 of file ParserOptions.php.

Referenced by getEnableLimitReport().

◆ $mExpensiveParserFunctionLimit

ParserOptions::$mExpensiveParserFunctionLimit
private

Maximum number of calls per parse to expensive parser functions.

Definition at line 113 of file ParserOptions.php.

Referenced by getExpensiveParserFunctionLimit().

◆ $mExternalLinkTarget

ParserOptions::$mExternalLinkTarget
private

Target attribute for external links.

Definition at line 150 of file ParserOptions.php.

Referenced by getExternalLinkTarget().

◆ $mExtraKey

ParserOptions::$mExtraKey = ''
private

Extra key that should be present in the caching key.

Definition at line 217 of file ParserOptions.php.

Referenced by optionsHash().

◆ $mInterfaceMessage

ParserOptions::$mInterfaceMessage = false
private

Which lang to call for PLURAL and GRAMMAR.

Definition at line 78 of file ParserOptions.php.

Referenced by getInterfaceMessage().

◆ $mInterwikiMagic

ParserOptions::$mInterwikiMagic
private

Interlanguage links are removed and returned in an array.

Definition at line 38 of file ParserOptions.php.

Referenced by getInterwikiMagic().

◆ $mIsPreview

ParserOptions::$mIsPreview = false
private

Parsing the page for a "preview" operation?

Definition at line 202 of file ParserOptions.php.

Referenced by getIsPreview().

◆ $mIsPrintable

ParserOptions::$mIsPrintable = false
private

Parsing the printable version of the page?

Definition at line 212 of file ParserOptions.php.

Referenced by getIsPrintable().

◆ $mIsSectionPreview

ParserOptions::$mIsSectionPreview = false
private

Parsing the page for a "preview" operation on a single section?

Definition at line 207 of file ParserOptions.php.

Referenced by getIsSectionPreview().

◆ $mMagicISBNLinks

ParserOptions::$mMagicISBNLinks = true
private

Are magic ISBN links enabled?

Definition at line 222 of file ParserOptions.php.

Referenced by getMagicISBNLinks().

◆ $mMagicPMIDLinks

ParserOptions::$mMagicPMIDLinks = true
private

Are magic PMID links enabled?

Definition at line 227 of file ParserOptions.php.

Referenced by getMagicPMIDLinks().

◆ $mMagicRFCLinks

ParserOptions::$mMagicRFCLinks = true
private

Are magic RFC links enabled?

Definition at line 232 of file ParserOptions.php.

Referenced by getMagicRFCLinks().

◆ $mMaxGeneratedPPNodeCount

ParserOptions::$mMaxGeneratedPPNodeCount
private

Maximum number of nodes generated by Preprocessor::preprocessToObj()

Definition at line 98 of file ParserOptions.php.

Referenced by getMaxGeneratedPPNodeCount().

◆ $mMaxIncludeSize

ParserOptions::$mMaxIncludeSize
private

Maximum size of template expansions, in bytes.

Definition at line 88 of file ParserOptions.php.

Referenced by getMaxIncludeSize().

◆ $mMaxPPExpandDepth

ParserOptions::$mMaxPPExpandDepth
private

Maximum recursion depth in PPFrame::expand()

Definition at line 103 of file ParserOptions.php.

Referenced by getMaxPPExpandDepth().

◆ $mMaxPPNodeCount

ParserOptions::$mMaxPPNodeCount
private

Maximum number of nodes touched by PPFrame::expand()

Definition at line 93 of file ParserOptions.php.

Referenced by getMaxPPNodeCount().

◆ $mMaxTemplateDepth

ParserOptions::$mMaxTemplateDepth
private

Maximum recursion depth for templates within templates.

Definition at line 108 of file ParserOptions.php.

Referenced by getMaxTemplateDepth().

◆ $mNumberHeadings

ParserOptions::$mNumberHeadings
private

Automatically number headings?

Definition at line 176 of file ParserOptions.php.

Referenced by getNumberHeadings().

◆ $mPreSaveTransform

ParserOptions::$mPreSaveTransform = true
private

Transform wiki markup when saving the page?

Definition at line 161 of file ParserOptions.php.

Referenced by getPreSaveTransform().

◆ $mRemoveComments

ParserOptions::$mRemoveComments = true
private

Remove HTML comments.

ONLY APPLIES TO PREPROCESS OPERATIONS

Definition at line 118 of file ParserOptions.php.

Referenced by getRemoveComments().

◆ $mSpeculativeRevIdCallback

callable null ParserOptions::$mSpeculativeRevIdCallback
private

Callback to generate a guess for {{REVISIONID}}.

Definition at line 135 of file ParserOptions.php.

Referenced by getSpeculativeRevIdCallback().

◆ $mStubThreshold

ParserOptions::$mStubThreshold
private

Maximum article size of an article to be marked as "stub".

Definition at line 186 of file ParserOptions.php.

Referenced by getStubThreshold(), and optionsHash().

◆ $mTargetLanguage

ParserOptions::$mTargetLanguage = null
private

Overrides $mInterfaceMessage with arbitrary language.

Definition at line 83 of file ParserOptions.php.

Referenced by getTargetLanguage().

◆ $mTemplateCallback

callable ParserOptions::$mTemplateCallback
private
Initial value:
=
[ 'Parser', 'statelessFetchTemplate' ]

Callback for template fetching; first argument to call_user_func().

Definition at line 129 of file ParserOptions.php.

Referenced by getTemplateCallback().

◆ $mThumbSize

ParserOptions::$mThumbSize
private

Thumb size preferred by the user.

Definition at line 181 of file ParserOptions.php.

Referenced by getThumbSize(), and optionsHash().

◆ $mTidy

ParserOptions::$mTidy = false
private

Use tidy to cleanup output HTML?

Definition at line 73 of file ParserOptions.php.

Referenced by getTidy().

◆ $mTimestamp

ParserOptions::$mTimestamp
private

Timestamp used for {{CURRENTDAY}} etc.

Definition at line 145 of file ParserOptions.php.

Referenced by getTimestamp().

◆ $mUser

User ParserOptions::$mUser
private

Stored user object.

Definition at line 197 of file ParserOptions.php.

Referenced by getUser().

◆ $mUserLang

ParserOptions::$mUserLang
private

Language object of the User language.

Definition at line 191 of file ParserOptions.php.

Referenced by getUserLangObj().

◆ $onAccessCallback

ParserOptions::$onAccessCallback = null
private

Function to be called when an option is accessed.

Definition at line 237 of file ParserOptions.php.

◆ $redirectTarget

Title null ParserOptions::$redirectTarget = null
private

If the page being parsed is a redirect, this should hold the redirect target.

Definition at line 244 of file ParserOptions.php.

Referenced by getRedirectTarget().


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