Go to the documentation of this file.
122 array(
'Parser',
'statelessFetchTemplate' );
252 if ( !isset( $this->mDateFormat ) ) {
253 $this->mDateFormat = $this->mUser->getDatePreference();
259 if ( !isset( $this->mTimestamp ) ) {
325 if ( is_string( $x ) ) {
328 return wfSetVar( $this->mUserLang, $x );
342 $this->mExtraKey .=
'!' . $key;
351 if (
$user ===
null ) {
359 if ( $lang ===
null ) {
408 global $wgInterwikiMagic, $wgAllowExternalImages,
409 $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion,
410 $wgMaxArticleSize, $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth,
411 $wgCleanSignatures, $wgExternalLinkTarget, $wgExpensiveParserFunctionLimit,
412 $wgMaxGeneratedPPNodeCount, $wgDisableLangConversion, $wgDisableTitleConversion;
416 $this->mInterwikiMagic = $wgInterwikiMagic;
417 $this->mAllowExternalImages = $wgAllowExternalImages;
418 $this->mAllowExternalImagesFrom = $wgAllowExternalImagesFrom;
419 $this->mEnableImageWhitelist = $wgEnableImageWhitelist;
420 $this->mAllowSpecialInclusion = $wgAllowSpecialInclusion;
421 $this->mMaxIncludeSize = $wgMaxArticleSize * 1024;
422 $this->mMaxPPNodeCount = $wgMaxPPNodeCount;
423 $this->mMaxGeneratedPPNodeCount = $wgMaxGeneratedPPNodeCount;
424 $this->mMaxPPExpandDepth = $wgMaxPPExpandDepth;
425 $this->mMaxTemplateDepth = $wgMaxTemplateDepth;
426 $this->mExpensiveParserFunctionLimit = $wgExpensiveParserFunctionLimit;
427 $this->mCleanSignatures = $wgCleanSignatures;
428 $this->mExternalLinkTarget = $wgExternalLinkTarget;
429 $this->mDisableContentConversion = $wgDisableLangConversion;
430 $this->mDisableTitleConversion = $wgDisableLangConversion || $wgDisableTitleConversion;
432 $this->mUser =
$user;
433 $this->mNumberHeadings =
$user->getOption(
'numberheadings' );
434 $this->mThumbSize =
$user->getOption(
'thumbsize' );
435 $this->mStubThreshold =
$user->getStubThreshold();
436 $this->mUserLang = $lang;
446 $this->onAccessCallback = $callback;
454 if ( $this->onAccessCallback ) {
455 call_user_func( $this->onAccessCallback, $optionName );
466 return array(
'stubthreshold',
'numberheadings',
'userlang',
'thumbsize',
'editsection',
'printable' );
486 global $wgRenderHashAppend;
496 if ( in_array(
'stubthreshold', $forOptions ) ) {
502 if ( in_array(
'dateformat', $forOptions ) ) {
506 if ( in_array(
'numberheadings', $forOptions ) ) {
507 $confstr .=
'!' . ( $this->mNumberHeadings ?
'1' :
'' );
512 if ( in_array(
'userlang', $forOptions ) ) {
513 $confstr .=
'!' . $this->mUserLang->getCode();
518 if ( in_array(
'thumbsize', $forOptions ) ) {
526 if ( !is_null(
$title ) ) {
527 $confstr .=
$title->getPageLanguage()->getExtraHashOptions();
533 $confstr .= $wgRenderHashAppend;
535 if ( !in_array(
'editsection', $forOptions ) ) {
537 } elseif ( !$this->mEditSection ) {
538 $confstr .=
'!edit=0';
541 if ( $this->mIsPrintable && in_array(
'printable', $forOptions ) ) {
542 $confstr .=
'!printable=1';
545 if ( $this->mExtraKey !=
'' ) {
554 $confstr = str_replace(
' ',
'_', $confstr );
$onAccessCallback
Function to be called when an option is accessed.
Set options of the Parser.
getAllowExternalImagesFrom()
getExpensiveParserFunctionLimit()
$mMaxTemplateDepth
Maximum recursion depth for templates within templates.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
disableContentConversion( $x=true)
$mStubThreshold
Maximum article size of an article to be marked as "stub".
initialiseFromUser( $user, $lang)
Get user options.
wfSetVar(&$dest, $source, $force=false)
Sets dest to source and returns the original value of dest If source is NULL, it just returns the val...
$mTargetLanguage
Overrides $mInterfaceMessage with arbitrary language.
getDisableTitleConversion()
setAllowExternalImages( $x)
wfProfileIn( $functionname)
Begin profiling of a function.
$mMaxPPExpandDepth
Maximum recursion depth in PPFrame::expand()
$mRemoveComments
Remove HTML comments.
setEnableImageWhitelist( $x)
$mMaxGeneratedPPNodeCount
Maximum number of nodes generated by Preprocessor::preprocessToObj()
$mIsPrintable
Parsing the printable version of the page?
disableTitleConversion( $x=true)
setMaxGeneratedPPNodeCount( $x)
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
getUserLangObj()
Get the user language used by the parser for this page.
$mPreSaveTransform
Transform wiki markup when saving the page?
registerWatcher( $callback)
Registers a callback for tracking which ParserOptions which are used.
$mInterfaceMessage
Which lang to call for PLURAL and GRAMMAR.
$mExpensiveParserFunctionLimit
Maximum number of calls per parse to expensive parser functions.
$mAllowExternalImages
Allow external images inline?
$mAllowSpecialInclusion
Allow inclusion of special pages?
$mTidy
Use tidy to cleanup output HTML?
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
static newFromUserAndLang(User $user, Language $lang)
Get a ParserOptions object from a given user and language.
getAllowSpecialInclusion()
$mUserLang
Language object of the User language.
$mDisableTitleConversion
Whether title conversion should be disabled.
$mIsSectionPreview
Parsing the page for a "preview" operation on a single section?
wfProfileOut( $functionname='missing')
Stop profiling of a function.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
getEnableImageWhitelist()
setExternalLinkTarget( $x)
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
setAllowSpecialInclusion( $x)
$mDateFormat
Date format index.
when a variable name is used in a it is silently declared as a new masking the global
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
getUserLang()
Same as getUserLangObj() but returns a string instead.
$mDisableContentConversion
Whether content conversion should be disabled.
$mExtraKey
Extra key that should be present in the caching key.
$mAllowExternalImagesFrom
If not, any exception?
getDisableContentConversion()
optionUsed( $optionName)
Called when an option is accessed.
presenting them properly to the user as errors is done by the caller $title
$mInterwikiMagic
Interlanguage links are removed and returned in an array.
$mEnableImageWhitelist
If not or it doesn't match, should we check an on-wiki whitelist?
static newFromContext(IContextSource $context)
Get a ParserOptions object from a IContextSource object.
$mMaxIncludeSize
Maximum size of template expansions, in bytes.
$mMaxPPNodeCount
Maximum number of nodes touched by PPFrame::expand()
$mTimestamp
Timestamp used for {{CURRENTDAY}} etc.
$mNumberHeadings
Automatically number headings?
getUser()
Get the User object.
setExpensiveParserFunctionLimit( $x)
$mEditSection
Create "edit section" links?
$mExternalLinkTarget
Target attribute for external links.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Interface for objects which can provide a context on request.
setAllowExternalImagesFrom( $x)
enableLimitReport( $x=true)
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
__construct( $user=null, $lang=null)
Constructor.
User $mUser
Stored user object.
$mIsPreview
Parsing the page for a "preview" operation?
static isRealObject( $obj)
Returns a bool value whenever $obj is a stub object.
static legacyOptions()
Returns the full array of options that would have been used by in 1.16.
static factory( $code)
Get a cached or new language object for a given language code.
getMaxGeneratedPPNodeCount()
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
$mCleanSignatures
Clean up signature texts?
$mEnableLimitReport
Enable limit report in an HTML comment on output.
Internationalisation code.
optionsHash( $forOptions, $title=null)
Generate a hash string with the values set on these ParserOptions for the keys given in the array.
$mThumbSize
Thumb size preferred by the user.
getLanguage()
Get the Language object.
static newFromUser( $user)
Get a ParserOptions object from a given user.
addExtraKey( $key)
Extra key that should be present in the parser cache key.
$mTemplateCallback
Callback for template fetching.