MediaWiki  1.23.16
ParserOptions.php
Go to the documentation of this file.
1 <?php
32 
37 
42 
47 
52 
56  var $mDateFormat = null;
57 
61  var $mEditSection = true;
62 
67 
71  var $mTidy = false;
72 
76  var $mInterfaceMessage = false;
77 
81  var $mTargetLanguage = null;
82 
87 
92 
97 
102 
107 
112 
116  var $mRemoveComments = true;
117 
122  array( 'Parser', 'statelessFetchTemplate' );
123 
127  var $mEnableLimitReport = false;
128 
133 
138 
146 
150  var $mPreSaveTransform = true;
151 
156 
161 
166 
171 
176 
181 
186  var $mUser;
187 
191  var $mIsPreview = false;
192 
196  var $mIsSectionPreview = false;
197 
201  var $mIsPrintable = false;
202 
206  var $mExtraKey = '';
207 
211  protected $onAccessCallback = null;
212 
217  function getEditSection() { return $this->mEditSection; }
218  function getNumberHeadings() { $this->optionUsed( 'numberheadings' );
221  function getTidy() { return $this->mTidy; }
228  function getMaxTemplateDepth() { return $this->mMaxTemplateDepth; }
229 
243  private $allowUnsafeRawHtml = true;
244 
245  /* @since 1.20 */
254  function getThumbSize() { $this->optionUsed( 'thumbsize' );
255  return $this->mThumbSize; }
256  function getStubThreshold() { $this->optionUsed( 'stubthreshold' );
258 
259  function getIsPreview() { return $this->mIsPreview; }
260  function getIsSectionPreview() { return $this->mIsSectionPreview; }
261  function getIsPrintable() { $this->optionUsed( 'printable' );
263  function getUser() { return $this->mUser; }
265 
266  function getDateFormat() {
267  $this->optionUsed( 'dateformat' );
268  if ( !isset( $this->mDateFormat ) ) {
269  $this->mDateFormat = $this->mUser->getDatePreference();
270  }
271  return $this->mDateFormat;
272  }
273 
274  function getTimestamp() {
275  if ( !isset( $this->mTimestamp ) ) {
276  $this->mTimestamp = wfTimestampNow();
277  }
278  return $this->mTimestamp;
279  }
280 
297  function getUserLangObj() {
298  $this->optionUsed( 'userlang' );
299  return $this->mUserLang;
300  }
301 
308  function getUserLang() {
309  return $this->getUserLangObj()->getCode();
310  }
311 
312  function setInterwikiMagic( $x ) { return wfSetVar( $this->mInterwikiMagic, $x ); }
313  function setAllowExternalImages( $x ) { return wfSetVar( $this->mAllowExternalImages, $x ); }
314  function setAllowExternalImagesFrom( $x ) { return wfSetVar( $this->mAllowExternalImagesFrom, $x ); }
315  function setEnableImageWhitelist( $x ) { return wfSetVar( $this->mEnableImageWhitelist, $x ); }
316  function setDateFormat( $x ) { return wfSetVar( $this->mDateFormat, $x ); }
317  function setEditSection( $x ) { return wfSetVar( $this->mEditSection, $x ); }
318  function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); }
319  function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); }
320  function setTidy( $x ) { return wfSetVar( $this->mTidy, $x ); }
321 
323  function setSkin( $x ) { wfDeprecated( __METHOD__, '1.19' ); }
324  function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x ); }
325  function setTargetLanguage( $x ) { return wfSetVar( $this->mTargetLanguage, $x, true ); }
326  function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); }
327  function setMaxPPNodeCount( $x ) { return wfSetVar( $this->mMaxPPNodeCount, $x ); }
328  function setMaxGeneratedPPNodeCount( $x ) { return wfSetVar( $this->mMaxGeneratedPPNodeCount, $x ); }
329  function setMaxTemplateDepth( $x ) { return wfSetVar( $this->mMaxTemplateDepth, $x ); }
330 
335  public function getAllowUnsafeRawHtml() {
337  }
338 
339  /* @since 1.20 */
340  function setExpensiveParserFunctionLimit( $x ) { return wfSetVar( $this->mExpensiveParserFunctionLimit, $x ); }
341  function setRemoveComments( $x ) { return wfSetVar( $this->mRemoveComments, $x ); }
342  function setTemplateCallback( $x ) { return wfSetVar( $this->mTemplateCallback, $x ); }
343  function enableLimitReport( $x = true ) { return wfSetVar( $this->mEnableLimitReport, $x ); }
344  function setTimestamp( $x ) { return wfSetVar( $this->mTimestamp, $x ); }
345  function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); }
346  function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); }
347  function disableContentConversion( $x = true ) { return wfSetVar( $this->mDisableContentConversion, $x ); }
348  function disableTitleConversion( $x = true ) { return wfSetVar( $this->mDisableTitleConversion, $x ); }
349  function setUserLang( $x ) {
350  if ( is_string( $x ) ) {
351  $x = Language::factory( $x );
352  }
353  return wfSetVar( $this->mUserLang, $x );
354  }
355  function setThumbSize( $x ) { return wfSetVar( $this->mThumbSize, $x ); }
356  function setStubThreshold( $x ) { return wfSetVar( $this->mStubThreshold, $x ); }
357  function setPreSaveTransform( $x ) { return wfSetVar( $this->mPreSaveTransform, $x ); }
358 
359  function setIsPreview( $x ) { return wfSetVar( $this->mIsPreview, $x ); }
360  function setIsSectionPreview( $x ) { return wfSetVar( $this->mIsSectionPreview, $x ); }
361  function setIsPrintable( $x ) { return wfSetVar( $this->mIsPrintable, $x ); }
362 
368  public function setAllowUnsafeRawHtml( $x ) {
369  return wfSetVar( $this->allowUnsafeRawHtml, $x );
370  }
371 
375  function addExtraKey( $key ) {
376  $this->mExtraKey .= '!' . $key;
377  }
378 
384  function __construct( $user = null, $lang = null ) {
385  if ( $user === null ) {
386  global $wgUser;
387  if ( $wgUser === null ) {
388  $user = new User;
389  } else {
390  $user = $wgUser;
391  }
392  }
393  if ( $lang === null ) {
394  global $wgLang;
395  if ( !StubObject::isRealObject( $wgLang ) ) {
396  $wgLang->_unstub();
397  }
398  $lang = $wgLang;
399  }
400  $this->initialiseFromUser( $user, $lang );
401  }
402 
410  public static function newFromUser( $user ) {
411  return new ParserOptions( $user );
412  }
413 
421  public static function newFromUserAndLang( User $user, Language $lang ) {
422  return new ParserOptions( $user, $lang );
423  }
424 
431  public static function newFromContext( IContextSource $context ) {
432  return new ParserOptions( $context->getUser(), $context->getLanguage() );
433  }
434 
441  private function initialiseFromUser( $user, $lang ) {
442  global $wgInterwikiMagic, $wgAllowExternalImages,
443  $wgAllowExternalImagesFrom, $wgEnableImageWhitelist, $wgAllowSpecialInclusion,
444  $wgMaxArticleSize, $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth,
445  $wgCleanSignatures, $wgExternalLinkTarget, $wgExpensiveParserFunctionLimit,
446  $wgMaxGeneratedPPNodeCount, $wgDisableLangConversion, $wgDisableTitleConversion;
447 
448  wfProfileIn( __METHOD__ );
449 
450  $this->mInterwikiMagic = $wgInterwikiMagic;
451  $this->mAllowExternalImages = $wgAllowExternalImages;
452  $this->mAllowExternalImagesFrom = $wgAllowExternalImagesFrom;
453  $this->mEnableImageWhitelist = $wgEnableImageWhitelist;
454  $this->mAllowSpecialInclusion = $wgAllowSpecialInclusion;
455  $this->mMaxIncludeSize = $wgMaxArticleSize * 1024;
456  $this->mMaxPPNodeCount = $wgMaxPPNodeCount;
457  $this->mMaxGeneratedPPNodeCount = $wgMaxGeneratedPPNodeCount;
458  $this->mMaxPPExpandDepth = $wgMaxPPExpandDepth;
459  $this->mMaxTemplateDepth = $wgMaxTemplateDepth;
460  $this->mExpensiveParserFunctionLimit = $wgExpensiveParserFunctionLimit;
461  $this->mCleanSignatures = $wgCleanSignatures;
462  $this->mExternalLinkTarget = $wgExternalLinkTarget;
463  $this->mDisableContentConversion = $wgDisableLangConversion;
464  $this->mDisableTitleConversion = $wgDisableLangConversion || $wgDisableTitleConversion;
465 
466  $this->mUser = $user;
467  $this->mNumberHeadings = $user->getOption( 'numberheadings' );
468  $this->mThumbSize = $user->getOption( 'thumbsize' );
469  $this->mStubThreshold = $user->getStubThreshold();
470  $this->mUserLang = $lang;
471 
472  wfProfileOut( __METHOD__ );
473  }
474 
479  function registerWatcher( $callback ) {
480  $this->onAccessCallback = $callback;
481  }
482 
487  public function optionUsed( $optionName ) {
488  if ( $this->onAccessCallback ) {
489  call_user_func( $this->onAccessCallback, $optionName );
490  }
491  }
492 
499  public static function legacyOptions() {
500  return array( 'stubthreshold', 'numberheadings', 'userlang', 'thumbsize', 'editsection', 'printable' );
501  }
502 
519  public function optionsHash( $forOptions, $title = null ) {
520  global $wgRenderHashAppend;
521 
522  // FIXME: Once the cache key is reorganized this argument
523  // can be dropped. It was used when the math extension was
524  // part of core.
525  $confstr = '*';
526 
527  // Space assigned for the stubthreshold but unused
528  // since it disables the parser cache, its value will always
529  // be 0 when this function is called by parsercache.
530  if ( in_array( 'stubthreshold', $forOptions ) ) {
531  $confstr .= '!' . $this->mStubThreshold;
532  } else {
533  $confstr .= '!*';
534  }
535 
536  if ( in_array( 'dateformat', $forOptions ) ) {
537  $confstr .= '!' . $this->getDateFormat();
538  }
539 
540  if ( in_array( 'numberheadings', $forOptions ) ) {
541  $confstr .= '!' . ( $this->mNumberHeadings ? '1' : '' );
542  } else {
543  $confstr .= '!*';
544  }
545 
546  if ( in_array( 'userlang', $forOptions ) ) {
547  $confstr .= '!' . $this->mUserLang->getCode();
548  } else {
549  $confstr .= '!*';
550  }
551 
552  if ( in_array( 'thumbsize', $forOptions ) ) {
553  $confstr .= '!' . $this->mThumbSize;
554  } else {
555  $confstr .= '!*';
556  }
557 
558  // add in language specific options, if any
559  // @todo FIXME: This is just a way of retrieving the url/user preferred variant
560  if ( !is_null( $title ) ) {
561  $confstr .= $title->getPageLanguage()->getExtraHashOptions();
562  } else {
564  $confstr .= $wgContLang->getExtraHashOptions();
565  }
566 
567  $confstr .= $wgRenderHashAppend;
568 
569  if ( !in_array( 'editsection', $forOptions ) ) {
570  $confstr .= '!*';
571  } elseif ( !$this->mEditSection ) {
572  $confstr .= '!edit=0';
573  }
574 
575  if ( $this->mIsPrintable && in_array( 'printable', $forOptions ) ) {
576  $confstr .= '!printable=1';
577  }
578 
579  if ( $this->mExtraKey != '' ) {
580  $confstr .= $this->mExtraKey;
581  }
582 
583  // Give a chance for extensions to modify the hash, if they have
584  // extra options or other effects on the parser cache.
585  wfRunHooks( 'PageRenderingHash', array( &$confstr, $this->getUser(), &$forOptions ) );
586 
587  // Make it a valid memcached key fragment
588  $confstr = str_replace( ' ', '_', $confstr );
589 
590  return $confstr;
591  }
592 }
ParserOptions\$onAccessCallback
$onAccessCallback
Function to be called when an option is accessed.
Definition: ParserOptions.php:210
ParserOptions\setMaxIncludeSize
setMaxIncludeSize( $x)
Definition: ParserOptions.php:324
ParserOptions
Set options of the Parser.
Definition: ParserOptions.php:31
ParserOptions\getAllowExternalImagesFrom
getAllowExternalImagesFrom()
Definition: ParserOptions.php:214
$wgUser
$wgUser
Definition: Setup.php:572
ParserOptions\getExpensiveParserFunctionLimit
getExpensiveParserFunctionLimit()
Definition: ParserOptions.php:244
ParserOptions\$mMaxTemplateDepth
$mMaxTemplateDepth
Maximum recursion depth for templates within templates.
Definition: ParserOptions.php:106
ParserOptions\setTidy
setTidy( $x)
Definition: ParserOptions.php:318
ParserOptions\getIsSectionPreview
getIsSectionPreview()
Definition: ParserOptions.php:258
php
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
Definition: skin.txt:62
ParserOptions\getRemoveComments
getRemoveComments()
Definition: ParserOptions.php:245
ParserOptions\setAllowUnsafeRawHtml
setAllowUnsafeRawHtml( $x)
Definition: ParserOptions.php:366
ParserOptions\disableContentConversion
disableContentConversion( $x=true)
Definition: ParserOptions.php:345
ParserOptions\$mStubThreshold
$mStubThreshold
Maximum article size of an article to be marked as "stub".
Definition: ParserOptions.php:175
ParserOptions\initialiseFromUser
initialiseFromUser( $user, $lang)
Get user options.
Definition: ParserOptions.php:439
wfSetVar
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...
Definition: GlobalFunctions.php:2186
ParserOptions\$mTargetLanguage
$mTargetLanguage
Overrides $mInterfaceMessage with arbitrary language.
Definition: ParserOptions.php:81
ParserOptions\getIsPreview
getIsPreview()
Definition: ParserOptions.php:257
ParserOptions\$allowUnsafeRawHtml
boolean $allowUnsafeRawHtml
If the wiki is configured to allow raw html ($wgRawHtml = true) is it allowed in the specific case of...
Definition: ParserOptions.php:241
ParserOptions\getDisableTitleConversion
getDisableTitleConversion()
Definition: ParserOptions.php:251
ParserOptions\setAllowExternalImages
setAllowExternalImages( $x)
Definition: ParserOptions.php:311
ParserOptions\setTemplateCallback
setTemplateCallback( $x)
Definition: ParserOptions.php:340
ParserOptions\setIsPreview
setIsPreview( $x)
Definition: ParserOptions.php:357
wfProfileIn
wfProfileIn( $functionname)
Begin profiling of a function.
Definition: Profiler.php:33
ParserOptions\setTargetLanguage
setTargetLanguage( $x)
Definition: ParserOptions.php:323
ParserOptions\$mMaxPPExpandDepth
$mMaxPPExpandDepth
Maximum recursion depth in PPFrame::expand()
Definition: ParserOptions.php:101
ParserOptions\$mRemoveComments
$mRemoveComments
Remove HTML comments.
Definition: ParserOptions.php:116
ParserOptions\getInterfaceMessage
getInterfaceMessage()
Definition: ParserOptions.php:221
ParserOptions\setIsSectionPreview
setIsSectionPreview( $x)
Definition: ParserOptions.php:358
ParserOptions\setEnableImageWhitelist
setEnableImageWhitelist( $x)
Definition: ParserOptions.php:313
ParserOptions\$mMaxGeneratedPPNodeCount
$mMaxGeneratedPPNodeCount
Maximum number of nodes generated by Preprocessor::preprocessToObj()
Definition: ParserOptions.php:96
ParserOptions\$mIsPrintable
$mIsPrintable
Parsing the printable version of the page?
Definition: ParserOptions.php:200
ParserOptions\disableTitleConversion
disableTitleConversion( $x=true)
Definition: ParserOptions.php:346
ParserOptions\getIsPrintable
getIsPrintable()
Definition: ParserOptions.php:259
ParserOptions\setMaxGeneratedPPNodeCount
setMaxGeneratedPPNodeCount( $x)
Definition: ParserOptions.php:326
$wgContLang
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
Definition: design.txt:56
ParserOptions\setMaxTemplateDepth
setMaxTemplateDepth( $x)
Definition: ParserOptions.php:327
ParserOptions\getUserLangObj
getUserLangObj()
Get the user language used by the parser for this page.
Definition: ParserOptions.php:295
ParserOptions\$mPreSaveTransform
$mPreSaveTransform
Transform wiki markup when saving the page?
Definition: ParserOptions.php:150
ParserOptions\registerWatcher
registerWatcher( $callback)
Registers a callback for tracking which ParserOptions which are used.
Definition: ParserOptions.php:477
ParserOptions\getDateFormat
getDateFormat()
Definition: ParserOptions.php:264
ParserOptions\$mInterfaceMessage
$mInterfaceMessage
Which lang to call for PLURAL and GRAMMAR.
Definition: ParserOptions.php:76
ParserOptions\$mExpensiveParserFunctionLimit
$mExpensiveParserFunctionLimit
Maximum number of calls per parse to expensive parser functions.
Definition: ParserOptions.php:111
ParserOptions\$mAllowExternalImages
$mAllowExternalImages
Allow external images inline?
Definition: ParserOptions.php:41
ParserOptions\$mAllowSpecialInclusion
$mAllowSpecialInclusion
Allow inclusion of special pages?
Definition: ParserOptions.php:66
ParserOptions\setNumberHeadings
setNumberHeadings( $x)
Definition: ParserOptions.php:316
ParserOptions\$mTidy
$mTidy
Use tidy to cleanup output HTML?
Definition: ParserOptions.php:71
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
Definition: GlobalFunctions.php:1174
ParserOptions\newFromUserAndLang
static newFromUserAndLang(User $user, Language $lang)
Get a ParserOptions object from a given user and language.
Definition: ParserOptions.php:419
ParserOptions\setUserLang
setUserLang( $x)
Definition: ParserOptions.php:347
ParserOptions\getAllowSpecialInclusion
getAllowSpecialInclusion()
Definition: ParserOptions.php:219
ParserOptions\getTidy
getTidy()
Definition: ParserOptions.php:220
ParserOptions\getMaxIncludeSize
getMaxIncludeSize()
Definition: ParserOptions.php:223
ParserOptions\$mUserLang
$mUserLang
Language object of the User language.
Definition: ParserOptions.php:180
ParserOptions\$mDisableTitleConversion
$mDisableTitleConversion
Whether title conversion should be disabled.
Definition: ParserOptions.php:160
ParserOptions\$mIsSectionPreview
$mIsSectionPreview
Parsing the page for a "preview" operation on a single section?
Definition: ParserOptions.php:195
wfProfileOut
wfProfileOut( $functionname='missing')
Stop profiling of a function.
Definition: Profiler.php:46
ParserOptions\setSkin
setSkin( $x)
Definition: ParserOptions.php:321
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4066
ParserOptions\setThumbSize
setThumbSize( $x)
Definition: ParserOptions.php:353
ParserOptions\getEnableImageWhitelist
getEnableImageWhitelist()
Definition: ParserOptions.php:215
ParserOptions\setExternalLinkTarget
setExternalLinkTarget( $x)
Definition: ParserOptions.php:344
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ParserOptions\setDateFormat
setDateFormat( $x)
Definition: ParserOptions.php:314
ParserOptions\getTargetLanguage
getTargetLanguage()
Definition: ParserOptions.php:222
ParserOptions\setAllowSpecialInclusion
setAllowSpecialInclusion( $x)
Definition: ParserOptions.php:317
ParserOptions\getExternalLinkTarget
getExternalLinkTarget()
Definition: ParserOptions.php:249
ParserOptions\$mDateFormat
$mDateFormat
Date format index.
Definition: ParserOptions.php:56
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
wfTimestampNow
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
Definition: GlobalFunctions.php:2561
ParserOptions\getStubThreshold
getStubThreshold()
Definition: ParserOptions.php:254
ParserOptions\getUserLang
getUserLang()
Same as getUserLangObj() but returns a string instead.
Definition: ParserOptions.php:306
ParserOptions\getPreSaveTransform
getPreSaveTransform()
Definition: ParserOptions.php:262
ParserOptions\setStubThreshold
setStubThreshold( $x)
Definition: ParserOptions.php:354
ParserOptions\$mDisableContentConversion
$mDisableContentConversion
Whether content conversion should be disabled.
Definition: ParserOptions.php:155
ParserOptions\$mExtraKey
$mExtraKey
Extra key that should be present in the caching key.
Definition: ParserOptions.php:205
ParserOptions\getAllowUnsafeRawHtml
getAllowUnsafeRawHtml()
Definition: ParserOptions.php:333
ParserOptions\$mAllowExternalImagesFrom
$mAllowExternalImagesFrom
If not, any exception?
Definition: ParserOptions.php:46
ParserOptions\getDisableContentConversion
getDisableContentConversion()
Definition: ParserOptions.php:250
ParserOptions\optionUsed
optionUsed( $optionName)
Called when an option is accessed.
Definition: ParserOptions.php:485
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
ParserOptions\$mInterwikiMagic
$mInterwikiMagic
Interlanguage links are removed and returned in an array.
Definition: ParserOptions.php:36
ParserOptions\setTimestamp
setTimestamp( $x)
Definition: ParserOptions.php:342
ParserOptions\$mEnableImageWhitelist
$mEnableImageWhitelist
If not or it doesn't match, should we check an on-wiki whitelist?
Definition: ParserOptions.php:51
ParserOptions\setCleanSignatures
setCleanSignatures( $x)
Definition: ParserOptions.php:343
ParserOptions\newFromContext
static newFromContext(IContextSource $context)
Get a ParserOptions object from a IContextSource object.
Definition: ParserOptions.php:429
ParserOptions\$mMaxIncludeSize
$mMaxIncludeSize
Maximum size of template expansions, in bytes.
Definition: ParserOptions.php:86
ParserOptions\$mMaxPPNodeCount
$mMaxPPNodeCount
Maximum number of nodes touched by PPFrame::expand()
Definition: ParserOptions.php:91
ParserOptions\getTemplateCallback
getTemplateCallback()
Definition: ParserOptions.php:246
ParserOptions\$mTimestamp
$mTimestamp
Timestamp used for {{CURRENTDAY}} etc.
Definition: ParserOptions.php:132
ParserOptions\setRemoveComments
setRemoveComments( $x)
Definition: ParserOptions.php:339
ParserOptions\setInterwikiMagic
setInterwikiMagic( $x)
Definition: ParserOptions.php:310
ParserOptions\$mNumberHeadings
$mNumberHeadings
Automatically number headings?
Definition: ParserOptions.php:165
IContextSource\getUser
getUser()
Get the User object.
ParserOptions\setExpensiveParserFunctionLimit
setExpensiveParserFunctionLimit( $x)
Definition: ParserOptions.php:338
ParserOptions\getTimestamp
getTimestamp()
Definition: ParserOptions.php:272
ParserOptions\$mEditSection
$mEditSection
Create "edit section" links?
Definition: ParserOptions.php:61
ParserOptions\setMaxPPNodeCount
setMaxPPNodeCount( $x)
Definition: ParserOptions.php:325
ParserOptions\$mExternalLinkTarget
$mExternalLinkTarget
Target attribute for external links.
Definition: ParserOptions.php:137
$user
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
Definition: hooks.txt:237
IContextSource
Interface for objects which can provide a context on request.
Definition: IContextSource.php:29
ParserOptions\getCleanSignatures
getCleanSignatures()
Definition: ParserOptions.php:248
ParserOptions\setAllowExternalImagesFrom
setAllowExternalImagesFrom( $x)
Definition: ParserOptions.php:312
ParserOptions\enableLimitReport
enableLimitReport( $x=true)
Definition: ParserOptions.php:341
$wgLang
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
Definition: design.txt:56
ParserOptions\__construct
__construct( $user=null, $lang=null)
Constructor.
Definition: ParserOptions.php:382
ParserOptions\getInterwikiMagic
getInterwikiMagic()
Definition: ParserOptions.php:212
ParserOptions\$mUser
User $mUser
Stored user object.
Definition: ParserOptions.php:185
ParserOptions\setInterfaceMessage
setInterfaceMessage( $x)
Definition: ParserOptions.php:322
ParserOptions\getUser
getUser()
Definition: ParserOptions.php:261
ParserOptions\$mIsPreview
$mIsPreview
Parsing the page for a "preview" operation?
Definition: ParserOptions.php:190
ParserOptions\getThumbSize
getThumbSize()
Definition: ParserOptions.php:252
StubObject\isRealObject
static isRealObject( $obj)
Returns a bool value whenever $obj is a stub object.
Definition: StubObject.php:68
ParserOptions\setIsPrintable
setIsPrintable( $x)
Definition: ParserOptions.php:359
ParserOptions\getMaxPPNodeCount
getMaxPPNodeCount()
Definition: ParserOptions.php:224
ParserOptions\legacyOptions
static legacyOptions()
Returns the full array of options that would have been used by in 1.16.
Definition: ParserOptions.php:497
User
User
Definition: All_system_messages.txt:425
ParserOptions\setEditSection
setEditSection( $x)
Definition: ParserOptions.php:315
Language\factory
static factory( $code)
Get a cached or new language object for a given language code.
Definition: Language.php:184
ParserOptions\getMaxGeneratedPPNodeCount
getMaxGeneratedPPNodeCount()
Definition: ParserOptions.php:225
ParserOptions\getMaxPPExpandDepth
getMaxPPExpandDepth()
Definition: ParserOptions.php:226
ParserOptions\getEnableLimitReport
getEnableLimitReport()
Definition: ParserOptions.php:247
ParserOptions\getNumberHeadings
getNumberHeadings()
Definition: ParserOptions.php:217
ParserOptions\getMaxTemplateDepth
getMaxTemplateDepth()
Definition: ParserOptions.php:227
ParserOptions\setPreSaveTransform
setPreSaveTransform( $x)
Definition: ParserOptions.php:355
ParserOptions\getEditSection
getEditSection()
Definition: ParserOptions.php:216
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:59
ParserOptions\$mCleanSignatures
$mCleanSignatures
Clean up signature texts?
Definition: ParserOptions.php:145
ParserOptions\$mEnableLimitReport
$mEnableLimitReport
Enable limit report in an HTML comment on output.
Definition: ParserOptions.php:127
Language
Internationalisation code.
Definition: Language.php:74
ParserOptions\optionsHash
optionsHash( $forOptions, $title=null)
Generate a hash string with the values set on these ParserOptions for the keys given in the array.
Definition: ParserOptions.php:517
ParserOptions\$mThumbSize
$mThumbSize
Thumb size preferred by the user.
Definition: ParserOptions.php:170
IContextSource\getLanguage
getLanguage()
Get the Language object.
ParserOptions\getAllowExternalImages
getAllowExternalImages()
Definition: ParserOptions.php:213
ParserOptions\newFromUser
static newFromUser( $user)
Get a ParserOptions object from a given user.
Definition: ParserOptions.php:408
ParserOptions\addExtraKey
addExtraKey( $key)
Extra key that should be present in the parser cache key.
Definition: ParserOptions.php:373
ParserOptions\$mTemplateCallback
$mTemplateCallback
Callback for template fetching.
Definition: ParserOptions.php:121