Manual:ParserOptions.php
미디어위키 파일: ParserOptions.php | |
---|---|
위치: | includes/parser/ |
소스 코드: | master • 1.42.3 • 1.41.4 • 1.39.10 |
클래스: | ParserOptions |
설명
이 파일은 Parser 의 옵션을 설정합니다. 많은 변수와 함수들이 있습니다. 비록 실사용 시 변수를 private으로 선언하지 않는 경우가 많지만, 모든 변수를 private으로 선언하는 것을 권장합니다. ParserOptions는 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 transform 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()