Manuel:ParserOptions.php

From mediawiki.org
This page is a translated version of the page Manual:ParserOptions.php and the translation is 100% complete.

Description

Ce fichier initialise les paramètres de Parser . Il contient un nombre de variables et des fonctions pour obtenir et pour initialiser ces paramètres. Toutes les variables sont supposées être privées en théorie, bien qu'en pratique ce ne soit pas le cas. Les attributs de ParserOptions sont initialisés à l'aide d'un objet User .

Public methods

Public methods, excluding long deprecated ones and methods for internal use only:

  • getOption() - fetch an option and track that is was accessed
  • setOption() - set an option, generically
  • getInterwikiMagic() - whether to extract interlanguage links (boolean)
  • setInterwikiMagic() - specify whether to extract interlanguage links.
  • getAllowExternalImages() - whether to allow all external images inline
  • getAllowExternalImagesFrom() - what external images to allow
  • getEnableImageWhitelist() - whether to use the on-wiki external image whitelist
  • getAllowSpecialInclusion() - whether to allow inclusion of special pages
  • setAllowSpecialInclusion()
  • getInterfaceMessage() - whether to parse an interface message
  • setInterfaceMessage()
  • getTargetLanguage()
  • setTargetLanguage()
  • getMaxIncludeSize()
  • setMaxIncludeSize()
  • getMaxPPNodeCount()
  • setMaxPPNodeCount() - maximum number of nodes touched by PPFrame::expand()
  • getMaxPPExpandDepth() - maximum recursion depth in PPFrame::expand()
  • getMaxTemplateDepth() - maximum recursion depth for templates within templates
  • setMaxTemplateDepth()
  • getExpensiveParserFunctionLimit()
  • setExpensiveParserFunctionLimit()
  • getRemoveComments()
  • setRemoveComments()
  • getCleanSignatures()
  • setCleanSignatures()
  • getExternalLinkTarget() - target attribute for external links.
  • setExternalLinkTarget()
  • getDisableContentConversion()
  • disableContentConversion()
  • getDisableTitleConversion()
  • disableTitleConversion()
  • getThumbSize() - get the thumb size preferred by the user.
  • setThumbSize()
  • getIsPreview() - whether the page for a "preview" operation is being parsed.
  • setIsPreview()
  • getIsSectionPreview() - whether the page for a "preview" operation on a single section is being parsed.
  • setIsSectionPreview()
  • getIsPrintable() - whether the printable version of the page is being parsed.
  • setIsPrintable()
  • getPreSaveTransform() - whether to yransform wiki markup when saving the page
  • setPreSaveTransform()
  • getDateFormat()
  • setDateFormat()
  • getUserLangObj() - get the user language used by the parser for this page and split the parser cache.
  • setUserLangObj()
  • getUserLang() - same as getUserLangObj() but returns a string instead.
  • setUserLang()
  • getMagicISBNLinks()
  • getMagicPMIDLinks()
  • getMagicRFCLinks()
  • getSuppressTOC() - since 1.39. Should the table of contents be suppressed?
  • setSuppressTOC() - since 1.39.
  • getAllowUnsafeRawHtml()
  • setAllowUnsafeRawHtml()
  • getWrapOutputClass()
  • setWrapOutputClass()
  • getCurrentRevisionRecordCallback()
  • setCurrentRevisionRecordCallback()
  • getTemplateCallback() - callback for template fetching; first argument to call_user_func().
  • setTemplateCallback()
  • getSpeculativeRevId()
  • setSpeculativeRevIdCallback()
  • getSpeculativePageId()
  • setSpeculativePageIdCallback()
  • getTimestamp()
  • setTimestamp()
  • getRedirectTarget()
  • setRedirectTarget()
  • addExtraKey()
  • getUserIdentity()

Getting ParserOptions objects:

  • newFromAnon()
  • newFromUser() - get a ParserOptions object from a given user.
  • newFromUserAndLang() - get a ParserOptions object from a given user and language.
  • newFromContext() - get a ParserOptions object from a IContextSource object.
  • newFromUserAndLang()
  • newCanonical() - deprecated.

Checks, other:

  • matches() - check if these options match that of another options set
  • matchesForCacheKey()
  • registerWatcher() - register a callback for tracking which ParserOptions which are used.
  • optionUsed() - record that an option was internally accessed.
  • allCacheVaryingOptions()
  • optionsHash() - generate a hash string with the values set on these ParserOptions
  • isSafeToCache() - test whether these options are safe to cache.
  • setupFakeRevision()

Voir aussi