MediaWiki
REL1_20
|
Set options of the Parser. More...
Public Member Functions | |
__construct ($user=null, $lang=null) | |
Constructor. | |
addExtraKey ($key) | |
Extra key that should be present in the parser cache key. | |
disableContentConversion ($x=true) | |
disableTitleConversion ($x=true) | |
enableLimitReport ($x=true) | |
getAllowExternalImages () | |
getAllowExternalImagesFrom () | |
getAllowSpecialInclusion () | |
getCleanSignatures () | |
getDateFormat () | |
getDisableContentConversion () | |
getDisableTitleConversion () | |
getEditSection () | |
getEnableImageWhitelist () | |
getEnableLimitReport () | |
getExpensiveParserFunctionLimit () | |
getExternalLinkTarget () | |
getInterfaceMessage () | |
getInterwikiMagic () | |
getIsPreview () | |
getIsPrintable () | |
getIsSectionPreview () | |
getMath () | |
getMaxGeneratedPPNodeCount () | |
getMaxIncludeSize () | |
getMaxPPExpandDepth () | |
getMaxPPNodeCount () | |
getMaxTemplateDepth () | |
getNumberHeadings () | |
getPreSaveTransform () | |
getRemoveComments () | |
getSkin ($title=null) | |
getStubThreshold () | |
getTargetLanguage () | |
getTemplateCallback () | |
getThumbSize () | |
getTidy () | |
getTimestamp () | |
getUseDynamicDates () | |
getUser () | |
getUserLang () | |
Same as getUserLangObj() but returns a string instead. | |
getUserLangObj () | |
You shouldn't use this. | |
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. | |
setAllowExternalImages ($x) | |
setAllowExternalImagesFrom ($x) | |
setAllowSpecialInclusion ($x) | |
setCleanSignatures ($x) | |
setDateFormat ($x) | |
setEditSection ($x) | |
setEnableImageWhitelist ($x) | |
setExpensiveParserFunctionLimit ($x) | |
setExternalLinkTarget ($x) | |
setInterfaceMessage ($x) | |
setInterwikiMagic ($x) | |
setIsPreview ($x) | |
setIsPrintable ($x) | |
setIsSectionPreview ($x) | |
setMath ($x) | |
setMaxGeneratedPPNodeCount ($x) | |
setMaxIncludeSize ($x) | |
setMaxPPNodeCount ($x) | |
setMaxTemplateDepth ($x) | |
setNumberHeadings ($x) | |
setPreSaveTransform ($x) | |
setRemoveComments ($x) | |
setSkin ($x) | |
setStubThreshold ($x) | |
setTargetLanguage ($x) | |
setTemplateCallback ($x) | |
setThumbSize ($x) | |
setTidy ($x) | |
setTimestamp ($x) | |
setUseDynamicDates ($x) | |
setUserLang ($x) | |
Static Public Member Functions | |
static | legacyOptions () |
Returns the full array of options that would have been used by in 1.16. | |
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 | |
$mAllowExternalImages | |
Allow external images inline? | |
$mAllowExternalImagesFrom | |
If not, any exception? | |
$mAllowSpecialInclusion | |
Allow inclusion of special pages? | |
$mCleanSignatures | |
Clean up signature texts? | |
$mDateFormat = null | |
Date format index. | |
$mDisableContentConversion | |
Whether content conversion should be disabled. | |
$mDisableTitleConversion | |
Whether title conversion should be disabled. | |
$mEditSection = true | |
Create "edit section" links? | |
$mEnableImageWhitelist | |
If not or it doesn't match, should we check an on-wiki whitelist? | |
$mEnableLimitReport = false | |
Enable limit report in an HTML comment on output. | |
$mExpensiveParserFunctionLimit | |
Maximum number of calls per parse to expensive parser functions. | |
$mExternalLinkTarget | |
Target attribute for external links. | |
$mExtraKey = '' | |
Extra key that should be present in the caching key. | |
$mInterfaceMessage = false | |
Which lang to call for PLURAL and GRAMMAR. | |
$mInterwikiMagic | |
Interlanguage links are removed and returned in an array. | |
$mIsPreview = false | |
Parsing the page for a "preview" operation? | |
$mIsPrintable = false | |
Parsing the printable version of the page? | |
$mIsSectionPreview = false | |
Parsing the page for a "preview" operation on a single section? | |
$mMath | |
User math preference (as integer). | |
$mMaxGeneratedPPNodeCount | |
Maximum number of nodes generated by Preprocessor::preprocessToObj() | |
$mMaxIncludeSize | |
Maximum size of template expansions, in bytes. | |
$mMaxPPExpandDepth | |
Maximum recursion depth in PPFrame::expand() | |
$mMaxPPNodeCount | |
Maximum number of nodes touched by PPFrame::expand() | |
$mMaxTemplateDepth | |
Maximum recursion depth for templates within templates. | |
$mNumberHeadings | |
Automatically number headings? | |
$mPreSaveTransform = true | |
Transform wiki markup when saving the page? | |
$mRemoveComments = true | |
Remove HTML comments. | |
$mTargetLanguage = null | |
Overrides $mInterfaceMessage with arbitrary language. | |
$mTemplateCallback | |
Callback for template fetching. | |
$mThumbSize | |
Thumb size preferred by the user. | |
$mTidy = false | |
Use tidy to cleanup output HTML? | |
$mTimestamp | |
Timestamp used for {{CURRENTDAY}} etc. | |
$mUseDynamicDates | |
Use DateFormatter to format dates. | |
User | $mUser |
Stored user object. | |
$mUserLang | |
Language object of the User language. | |
Protected Member Functions | |
optionUsed ($optionName) | |
Called when an option is accessed. | |
Protected Attributes | |
$onAccessCallback = null | |
Function to be called when an option is accessed. | |
Private Member Functions | |
initialiseFromUser ($user, $lang) | |
Get user options. | |
Private Attributes | |
$mStubThreshold | |
Maximum article size of an article to be marked as "stub". |
Set options of the Parser.
All member variables are supposed to be private in theory, although in practise this is not the case.
Definition at line 31 of file ParserOptions.php.
ParserOptions::__construct | ( | $ | user = null , |
$ | lang = null |
||
) |
Constructor.
Definition at line 366 of file ParserOptions.php.
ParserOptions::addExtraKey | ( | $ | key | ) |
Extra key that should be present in the parser cache key.
Definition at line 357 of file ParserOptions.php.
ParserOptions::disableContentConversion | ( | $ | x = true | ) |
Definition at line 337 of file ParserOptions.php.
References wfSetVar().
ParserOptions::disableTitleConversion | ( | $ | x = true | ) |
Definition at line 338 of file ParserOptions.php.
References wfSetVar().
ParserOptions::enableLimitReport | ( | $ | x = true | ) |
Definition at line 333 of file ParserOptions.php.
References wfSetVar().
Definition at line 224 of file ParserOptions.php.
Definition at line 225 of file ParserOptions.php.
Definition at line 230 of file ParserOptions.php.
Definition at line 244 of file ParserOptions.php.
Definition at line 272 of file ParserOptions.php.
References optionUsed().
Definition at line 246 of file ParserOptions.php.
Definition at line 247 of file ParserOptions.php.
Definition at line 227 of file ParserOptions.php.
Definition at line 226 of file ParserOptions.php.
Definition at line 243 of file ParserOptions.php.
Definition at line 240 of file ParserOptions.php.
Definition at line 245 of file ParserOptions.php.
Definition at line 232 of file ParserOptions.php.
Definition at line 223 of file ParserOptions.php.
Definition at line 255 of file ParserOptions.php.
Definition at line 257 of file ParserOptions.php.
Definition at line 256 of file ParserOptions.php.
Definition at line 248 of file ParserOptions.php.
Definition at line 236 of file ParserOptions.php.
Definition at line 234 of file ParserOptions.php.
Definition at line 237 of file ParserOptions.php.
Definition at line 235 of file ParserOptions.php.
Definition at line 238 of file ParserOptions.php.
Definition at line 228 of file ParserOptions.php.
Definition at line 260 of file ParserOptions.php.
Definition at line 241 of file ParserOptions.php.
ParserOptions::getSkin | ( | $ | title = null | ) |
$title | Title |
Definition at line 267 of file ParserOptions.php.
Definition at line 252 of file ParserOptions.php.
Definition at line 233 of file ParserOptions.php.
Definition at line 242 of file ParserOptions.php.
Definition at line 250 of file ParserOptions.php.
Definition at line 231 of file ParserOptions.php.
Definition at line 280 of file ParserOptions.php.
References wfTimestampNow().
Definition at line 222 of file ParserOptions.php.
Definition at line 259 of file ParserOptions.php.
Same as getUserLangObj() but returns a string instead.
Definition at line 306 of file ParserOptions.php.
You shouldn't use this.
Really. $parser->getFunctionLang() is all you need. Using this fragments the cache and is discouraged. Yes, {{int: }} uses this, producing inconsistent tables (Bug 14404).
Definition at line 295 of file ParserOptions.php.
ParserOptions::initialiseFromUser | ( | $ | user, |
$ | lang | ||
) | [private] |
Get user options.
Definition at line 423 of file ParserOptions.php.
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.
Definition at line 482 of file ParserOptions.php.
Referenced by ParserCache\get(), ParserCache\getETag(), and ParserCache\getKey().
static ParserOptions::newFromContext | ( | IContextSource $ | context | ) | [static] |
Get a ParserOptions object from a IContextSource object.
$context | IContextSource object |
Definition at line 413 of file ParserOptions.php.
Referenced by ApiExpandTemplates\execute(), ApiQueryRevisions\extractRowInfo(), RawAction\getRawText(), Preferences\profilePreferences(), and NewParserTest\testParserTest().
static ParserOptions::newFromUser | ( | $ | user | ) | [static] |
Get a ParserOptions object from a given user.
Language will be taken from $wgLang.
$user | User object |
Definition at line 392 of file ParserOptions.php.
Referenced by CompareParsers\checkOptions(), PPFuzzTest\execute(), ParserCache\getKey(), DumpRenderer\handleRevision(), ExtraParserTest\testBug8689(), NewParserTest\testFuzzTests(), and ParserMethodsTest\testPreSaveTransform().
static ParserOptions::newFromUserAndLang | ( | User $ | user, |
Language $ | lang | ||
) | [static] |
Get a ParserOptions object from a given user and language.
Definition at line 403 of file ParserOptions.php.
Referenced by RefreshLinks\fixLinksFromArticle(), RefreshLinksJob\runForTitleInternal(), and ParserOptionsTest\setUp().
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 sharign the options with vary for the same page share the same cached data safely.
Replaces User::getPageRenderingHash()
Extensions which require it should install 'PageRenderingHash' hook, which will give them a chance to modify this key based on their own settings.
$forOptions | Array |
$title | Title: used to get the content language of the page (since r97636) |
Definition at line 509 of file ParserOptions.php.
ParserOptions::optionUsed | ( | $ | optionName | ) | [protected] |
Called when an option is accessed.
Definition at line 470 of file ParserOptions.php.
Referenced by getDateFormat().
ParserOptions::registerWatcher | ( | $ | callback | ) |
Registers a callback for tracking which ParserOptions which are used.
This is a private API with the parser.
Definition at line 463 of file ParserOptions.php.
Definition at line 312 of file ParserOptions.php.
References wfSetVar().
Definition at line 313 of file ParserOptions.php.
References wfSetVar().
Definition at line 318 of file ParserOptions.php.
References wfSetVar().
Definition at line 335 of file ParserOptions.php.
References wfSetVar().
ParserOptions::setDateFormat | ( | $ | x | ) |
Definition at line 315 of file ParserOptions.php.
References wfSetVar().
Definition at line 316 of file ParserOptions.php.
References wfSetVar().
Definition at line 314 of file ParserOptions.php.
References wfSetVar().
Definition at line 330 of file ParserOptions.php.
Definition at line 336 of file ParserOptions.php.
References wfSetVar().
Definition at line 323 of file ParserOptions.php.
References wfDeprecated().
Definition at line 311 of file ParserOptions.php.
References wfSetVar().
ParserOptions::setIsPreview | ( | $ | x | ) |
Definition at line 350 of file ParserOptions.php.
Definition at line 352 of file ParserOptions.php.
References wfSetVar().
Definition at line 351 of file ParserOptions.php.
References wfSetVar().
ParserOptions::setMath | ( | $ | x | ) |
Definition at line 339 of file ParserOptions.php.
References wfSetVar().
Definition at line 327 of file ParserOptions.php.
References wfSetVar().
Definition at line 325 of file ParserOptions.php.
References wfSetVar().
Definition at line 326 of file ParserOptions.php.
References wfSetVar().
Definition at line 328 of file ParserOptions.php.
References wfSetVar().
Definition at line 317 of file ParserOptions.php.
References wfSetVar().
Definition at line 348 of file ParserOptions.php.
References wfSetVar().
Definition at line 331 of file ParserOptions.php.
References wfSetVar().
ParserOptions::setSkin | ( | $ | x | ) |
Definition at line 322 of file ParserOptions.php.
Definition at line 347 of file ParserOptions.php.
References wfSetVar().
Definition at line 324 of file ParserOptions.php.
References wfSetVar().
Definition at line 332 of file ParserOptions.php.
References wfSetVar().
Referenced by ExtraParserTest\setUp().
ParserOptions::setThumbSize | ( | $ | x | ) |
Definition at line 346 of file ParserOptions.php.
ParserOptions::setTidy | ( | $ | x | ) |
Definition at line 319 of file ParserOptions.php.
References wfSetVar().
ParserOptions::setTimestamp | ( | $ | x | ) |
Definition at line 334 of file ParserOptions.php.
References wfSetVar().
Definition at line 310 of file ParserOptions.php.
ParserOptions::setUserLang | ( | $ | x | ) |
Definition at line 340 of file ParserOptions.php.
References wfSetVar().
ParserOptions::$mAllowExternalImages |
Allow external images inline?
Definition at line 46 of file ParserOptions.php.
ParserOptions::$mAllowExternalImagesFrom |
If not, any exception?
Definition at line 51 of file ParserOptions.php.
ParserOptions::$mAllowSpecialInclusion |
Allow inclusion of special pages?
Definition at line 71 of file ParserOptions.php.
ParserOptions::$mCleanSignatures |
Clean up signature texts?
1) Strip ~~~, ~~~~ and ~~~~~ out of signatures 2) Substitute all transclusions
Definition at line 150 of file ParserOptions.php.
ParserOptions::$mDateFormat = null |
Date format index.
Definition at line 61 of file ParserOptions.php.
ParserOptions::$mDisableContentConversion |
Whether content conversion should be disabled.
Definition at line 160 of file ParserOptions.php.
ParserOptions::$mDisableTitleConversion |
Whether title conversion should be disabled.
Definition at line 165 of file ParserOptions.php.
ParserOptions::$mEditSection = true |
Create "edit section" links?
Definition at line 66 of file ParserOptions.php.
ParserOptions::$mEnableImageWhitelist |
If not or it doesn't match, should we check an on-wiki whitelist?
Definition at line 56 of file ParserOptions.php.
ParserOptions::$mEnableLimitReport = false |
Enable limit report in an HTML comment on output.
Definition at line 132 of file ParserOptions.php.
ParserOptions::$mExpensiveParserFunctionLimit |
Maximum number of calls per parse to expensive parser functions.
Definition at line 116 of file ParserOptions.php.
ParserOptions::$mExternalLinkTarget |
Target attribute for external links.
Definition at line 142 of file ParserOptions.php.
ParserOptions::$mExtraKey = '' |
Extra key that should be present in the caching key.
Definition at line 215 of file ParserOptions.php.
ParserOptions::$mInterfaceMessage = false |
Which lang to call for PLURAL and GRAMMAR.
Definition at line 81 of file ParserOptions.php.
ParserOptions::$mInterwikiMagic |
Interlanguage links are removed and returned in an array.
Definition at line 41 of file ParserOptions.php.
ParserOptions::$mIsPreview = false |
Parsing the page for a "preview" operation?
Definition at line 200 of file ParserOptions.php.
ParserOptions::$mIsPrintable = false |
Parsing the printable version of the page?
Definition at line 210 of file ParserOptions.php.
ParserOptions::$mIsSectionPreview = false |
Parsing the page for a "preview" operation on a single section?
Definition at line 205 of file ParserOptions.php.
ParserOptions::$mMath |
User math preference (as integer).
Not used (1.19)
Definition at line 175 of file ParserOptions.php.
ParserOptions::$mMaxGeneratedPPNodeCount |
Maximum number of nodes generated by Preprocessor::preprocessToObj()
Definition at line 101 of file ParserOptions.php.
ParserOptions::$mMaxIncludeSize |
Maximum size of template expansions, in bytes.
Definition at line 91 of file ParserOptions.php.
ParserOptions::$mMaxPPExpandDepth |
Maximum recursion depth in PPFrame::expand()
Definition at line 106 of file ParserOptions.php.
ParserOptions::$mMaxPPNodeCount |
Maximum number of nodes touched by PPFrame::expand()
Definition at line 96 of file ParserOptions.php.
ParserOptions::$mMaxTemplateDepth |
Maximum recursion depth for templates within templates.
Definition at line 111 of file ParserOptions.php.
ParserOptions::$mNumberHeadings |
Automatically number headings?
Definition at line 170 of file ParserOptions.php.
ParserOptions::$mPreSaveTransform = true |
Transform wiki markup when saving the page?
Definition at line 155 of file ParserOptions.php.
ParserOptions::$mRemoveComments = true |
Remove HTML comments.
ONLY APPLIES TO PREPROCESS OPERATIONS
Definition at line 121 of file ParserOptions.php.
ParserOptions::$mStubThreshold [private] |
Maximum article size of an article to be marked as "stub".
Definition at line 185 of file ParserOptions.php.
ParserOptions::$mTargetLanguage = null |
Overrides $mInterfaceMessage with arbitrary language.
Definition at line 86 of file ParserOptions.php.
ParserOptions::$mTemplateCallback |
array( 'Parser', 'statelessFetchTemplate' )
Callback for template fetching.
Used as first argument to call_user_func().
Definition at line 126 of file ParserOptions.php.
ParserOptions::$mThumbSize |
Thumb size preferred by the user.
Definition at line 180 of file ParserOptions.php.
ParserOptions::$mTidy = false |
Use tidy to cleanup output HTML?
Definition at line 76 of file ParserOptions.php.
ParserOptions::$mTimestamp |
Timestamp used for {{CURRENTDAY}} etc.
Definition at line 137 of file ParserOptions.php.
ParserOptions::$mUseDynamicDates |
Use DateFormatter to format dates.
Definition at line 36 of file ParserOptions.php.
User ParserOptions::$mUser |
Stored user object.
Definition at line 195 of file ParserOptions.php.
ParserOptions::$mUserLang |
Language object of the User language.
Definition at line 190 of file ParserOptions.php.
ParserOptions::$onAccessCallback = null [protected] |
Function to be called when an option is accessed.
Definition at line 220 of file ParserOptions.php.