MediaWiki  master
ParserOptions.php
Go to the documentation of this file.
1 <?php
33 
38 
43 
48 
53 
57  private $mDateFormat = null;
58 
62  private $mEditSection = true;
63 
68 
72  private $mTidy = false;
73 
77  private $mInterfaceMessage = false;
78 
82  private $mTargetLanguage = null;
83 
88 
93 
98 
103 
108 
113 
117  private $mRemoveComments = true;
118 
123  [ 'Parser', 'statelessFetchRevision' ];
124 
129  [ 'Parser', 'statelessFetchTemplate' ];
130 
135 
139  private $mEnableLimitReport = false;
140 
144  private $mTimestamp;
145 
150 
156 
160  private $mPreSaveTransform = true;
161 
166 
171 
176 
180  private $mThumbSize;
181 
186 
190  private $mUserLang;
191 
196  private $mUser;
197 
201  private $mIsPreview = false;
202 
206  private $mIsSectionPreview = false;
207 
211  private $mIsPrintable = false;
212 
216  private $mExtraKey = '';
217 
221  private $onAccessCallback = null;
222 
228  private $redirectTarget = null;
229 
230  public function getInterwikiMagic() {
231  return $this->mInterwikiMagic;
232  }
233 
234  public function getAllowExternalImages() {
236  }
237 
238  public function getAllowExternalImagesFrom() {
240  }
241 
242  public function getEnableImageWhitelist() {
244  }
245 
246  public function getEditSection() {
247  return $this->mEditSection;
248  }
249 
250  public function getNumberHeadings() {
251  $this->optionUsed( 'numberheadings' );
252 
253  return $this->mNumberHeadings;
254  }
255 
256  public function getAllowSpecialInclusion() {
258  }
259 
260  public function getTidy() {
261  return $this->mTidy;
262  }
263 
264  public function getInterfaceMessage() {
266  }
267 
268  public function getTargetLanguage() {
269  return $this->mTargetLanguage;
270  }
271 
272  public function getMaxIncludeSize() {
273  return $this->mMaxIncludeSize;
274  }
275 
276  public function getMaxPPNodeCount() {
277  return $this->mMaxPPNodeCount;
278  }
279 
280  public function getMaxGeneratedPPNodeCount() {
282  }
283 
284  public function getMaxPPExpandDepth() {
286  }
287 
288  public function getMaxTemplateDepth() {
290  }
291 
292  /* @since 1.20 */
295  }
296 
297  public function getRemoveComments() {
298  return $this->mRemoveComments;
299  }
300 
301  /* @since 1.24 */
302  public function getCurrentRevisionCallback() {
304  }
305 
306  public function getTemplateCallback() {
308  }
309 
311  public function getSpeculativeRevIdCallback() {
313  }
314 
315  public function getEnableLimitReport() {
317  }
318 
319  public function getCleanSignatures() {
321  }
322 
323  public function getExternalLinkTarget() {
325  }
326 
327  public function getDisableContentConversion() {
329  }
330 
331  public function getDisableTitleConversion() {
333  }
334 
335  public function getThumbSize() {
336  $this->optionUsed( 'thumbsize' );
337 
338  return $this->mThumbSize;
339  }
340 
341  public function getStubThreshold() {
342  $this->optionUsed( 'stubthreshold' );
343 
344  return $this->mStubThreshold;
345  }
346 
347  public function getIsPreview() {
348  return $this->mIsPreview;
349  }
350 
351  public function getIsSectionPreview() {
353  }
354 
355  public function getIsPrintable() {
356  $this->optionUsed( 'printable' );
357 
358  return $this->mIsPrintable;
359  }
360 
361  public function getUser() {
362  return $this->mUser;
363  }
364 
365  public function getPreSaveTransform() {
367  }
368 
369  public function getDateFormat() {
370  $this->optionUsed( 'dateformat' );
371  if ( !isset( $this->mDateFormat ) ) {
372  $this->mDateFormat = $this->mUser->getDatePreference();
373  }
374  return $this->mDateFormat;
375  }
376 
377  public function getTimestamp() {
378  if ( !isset( $this->mTimestamp ) ) {
379  $this->mTimestamp = wfTimestampNow();
380  }
381  return $this->mTimestamp;
382  }
383 
401  public function getUserLangObj() {
402  $this->optionUsed( 'userlang' );
403  return $this->mUserLang;
404  }
405 
418  public function getUserLang() {
419  return $this->getUserLangObj()->getCode();
420  }
421 
422  public function setInterwikiMagic( $x ) {
423  return wfSetVar( $this->mInterwikiMagic, $x );
424  }
425 
426  public function setAllowExternalImages( $x ) {
427  return wfSetVar( $this->mAllowExternalImages, $x );
428  }
429 
430  public function setAllowExternalImagesFrom( $x ) {
431  return wfSetVar( $this->mAllowExternalImagesFrom, $x );
432  }
433 
434  public function setEnableImageWhitelist( $x ) {
435  return wfSetVar( $this->mEnableImageWhitelist, $x );
436  }
437 
438  public function setDateFormat( $x ) {
439  return wfSetVar( $this->mDateFormat, $x );
440  }
441 
442  public function setEditSection( $x ) {
443  return wfSetVar( $this->mEditSection, $x );
444  }
445 
446  public function setNumberHeadings( $x ) {
447  return wfSetVar( $this->mNumberHeadings, $x );
448  }
449 
450  public function setAllowSpecialInclusion( $x ) {
451  return wfSetVar( $this->mAllowSpecialInclusion, $x );
452  }
453 
454  public function setTidy( $x ) {
455  return wfSetVar( $this->mTidy, $x );
456  }
457 
458  public function setInterfaceMessage( $x ) {
459  return wfSetVar( $this->mInterfaceMessage, $x );
460  }
461 
462  public function setTargetLanguage( $x ) {
463  return wfSetVar( $this->mTargetLanguage, $x, true );
464  }
465 
466  public function setMaxIncludeSize( $x ) {
467  return wfSetVar( $this->mMaxIncludeSize, $x );
468  }
469 
470  public function setMaxPPNodeCount( $x ) {
471  return wfSetVar( $this->mMaxPPNodeCount, $x );
472  }
473 
474  public function setMaxGeneratedPPNodeCount( $x ) {
475  return wfSetVar( $this->mMaxGeneratedPPNodeCount, $x );
476  }
477 
478  public function setMaxTemplateDepth( $x ) {
479  return wfSetVar( $this->mMaxTemplateDepth, $x );
480  }
481 
482  /* @since 1.20 */
483  public function setExpensiveParserFunctionLimit( $x ) {
484  return wfSetVar( $this->mExpensiveParserFunctionLimit, $x );
485  }
486 
487  public function setRemoveComments( $x ) {
488  return wfSetVar( $this->mRemoveComments, $x );
489  }
490 
491  /* @since 1.24 */
492  public function setCurrentRevisionCallback( $x ) {
493  return wfSetVar( $this->mCurrentRevisionCallback, $x );
494  }
495 
497  public function setSpeculativeRevIdCallback( $x ) {
498  return wfSetVar( $this->mSpeculativeRevIdCallback, $x );
499  }
500 
501  public function setTemplateCallback( $x ) {
502  return wfSetVar( $this->mTemplateCallback, $x );
503  }
504 
505  public function enableLimitReport( $x = true ) {
506  return wfSetVar( $this->mEnableLimitReport, $x );
507  }
508 
509  public function setTimestamp( $x ) {
510  return wfSetVar( $this->mTimestamp, $x );
511  }
512 
513  public function setCleanSignatures( $x ) {
514  return wfSetVar( $this->mCleanSignatures, $x );
515  }
516 
517  public function setExternalLinkTarget( $x ) {
518  return wfSetVar( $this->mExternalLinkTarget, $x );
519  }
520 
521  public function disableContentConversion( $x = true ) {
522  return wfSetVar( $this->mDisableContentConversion, $x );
523  }
524 
525  public function disableTitleConversion( $x = true ) {
526  return wfSetVar( $this->mDisableTitleConversion, $x );
527  }
528 
529  public function setUserLang( $x ) {
530  if ( is_string( $x ) ) {
531  $x = Language::factory( $x );
532  }
533 
534  return wfSetVar( $this->mUserLang, $x );
535  }
536 
537  public function setThumbSize( $x ) {
538  return wfSetVar( $this->mThumbSize, $x );
539  }
540 
541  public function setStubThreshold( $x ) {
542  return wfSetVar( $this->mStubThreshold, $x );
543  }
544 
545  public function setPreSaveTransform( $x ) {
546  return wfSetVar( $this->mPreSaveTransform, $x );
547  }
548 
549  public function setIsPreview( $x ) {
550  return wfSetVar( $this->mIsPreview, $x );
551  }
552 
553  public function setIsSectionPreview( $x ) {
554  return wfSetVar( $this->mIsSectionPreview, $x );
555  }
556 
557  public function setIsPrintable( $x ) {
558  return wfSetVar( $this->mIsPrintable, $x );
559  }
560 
571  function setRedirectTarget( $title ) {
572  $this->redirectTarget = $title;
573  }
574 
581  function getRedirectTarget() {
582  return $this->redirectTarget;
583  }
584 
589  public function addExtraKey( $key ) {
590  $this->mExtraKey .= '!' . $key;
591  }
592 
598  public function __construct( $user = null, $lang = null ) {
599  if ( $user === null ) {
600  global $wgUser;
601  if ( $wgUser === null ) {
602  $user = new User;
603  } else {
604  $user = $wgUser;
605  }
606  }
607  if ( $lang === null ) {
608  global $wgLang;
609  if ( !StubObject::isRealObject( $wgLang ) ) {
610  $wgLang->_unstub();
611  }
612  $lang = $wgLang;
613  }
614  $this->initialiseFromUser( $user, $lang );
615  }
616 
622  public static function newFromAnon() {
624  return new ParserOptions( new User, $wgContLang );
625  }
626 
634  public static function newFromUser( $user ) {
635  return new ParserOptions( $user );
636  }
637 
645  public static function newFromUserAndLang( User $user, Language $lang ) {
646  return new ParserOptions( $user, $lang );
647  }
648 
655  public static function newFromContext( IContextSource $context ) {
656  return new ParserOptions( $context->getUser(), $context->getLanguage() );
657  }
658 
665  private function initialiseFromUser( $user, $lang ) {
666  global $wgInterwikiMagic, $wgAllowExternalImages,
668  $wgMaxArticleSize, $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth,
670  $wgMaxGeneratedPPNodeCount, $wgDisableLangConversion, $wgDisableTitleConversion;
671 
672  // *UPDATE* ParserOptions::matches() if any of this changes as needed
673  $this->mInterwikiMagic = $wgInterwikiMagic;
674  $this->mAllowExternalImages = $wgAllowExternalImages;
675  $this->mAllowExternalImagesFrom = $wgAllowExternalImagesFrom;
676  $this->mEnableImageWhitelist = $wgEnableImageWhitelist;
677  $this->mAllowSpecialInclusion = $wgAllowSpecialInclusion;
678  $this->mMaxIncludeSize = $wgMaxArticleSize * 1024;
679  $this->mMaxPPNodeCount = $wgMaxPPNodeCount;
680  $this->mMaxGeneratedPPNodeCount = $wgMaxGeneratedPPNodeCount;
681  $this->mMaxPPExpandDepth = $wgMaxPPExpandDepth;
682  $this->mMaxTemplateDepth = $wgMaxTemplateDepth;
683  $this->mExpensiveParserFunctionLimit = $wgExpensiveParserFunctionLimit;
684  $this->mCleanSignatures = $wgCleanSignatures;
685  $this->mExternalLinkTarget = $wgExternalLinkTarget;
686  $this->mDisableContentConversion = $wgDisableLangConversion;
687  $this->mDisableTitleConversion = $wgDisableLangConversion || $wgDisableTitleConversion;
688 
689  $this->mUser = $user;
690  $this->mNumberHeadings = $user->getOption( 'numberheadings' );
691  $this->mThumbSize = $user->getOption( 'thumbsize' );
692  $this->mStubThreshold = $user->getStubThreshold();
693  $this->mUserLang = $lang;
694 
695  }
696 
706  public function matches( ParserOptions $other ) {
707  $fields = array_keys( get_class_vars( __CLASS__ ) );
708  $fields = array_diff( $fields, [
709  'mEnableLimitReport', // only effects HTML comments
710  'onAccessCallback', // only used for ParserOutput option tracking
711  ] );
712  foreach ( $fields as $field ) {
713  if ( !is_object( $this->$field ) && $this->$field !== $other->$field ) {
714  return false;
715  }
716  }
717  // Check the object and lazy-loaded options
718  return (
719  $this->mUserLang->equals( $other->mUserLang ) &&
720  $this->getDateFormat() === $other->getDateFormat()
721  );
722  }
723 
729  public function registerWatcher( $callback ) {
730  $this->onAccessCallback = $callback;
731  }
732 
741  public function optionUsed( $optionName ) {
742  if ( $this->onAccessCallback ) {
743  call_user_func( $this->onAccessCallback, $optionName );
744  }
745  }
746 
753  public static function legacyOptions() {
754  return [
755  'stubthreshold',
756  'numberheadings',
757  'userlang',
758  'thumbsize',
759  'editsection',
760  'printable'
761  ];
762  }
763 
780  public function optionsHash( $forOptions, $title = null ) {
782 
783  // FIXME: Once the cache key is reorganized this argument
784  // can be dropped. It was used when the math extension was
785  // part of core.
786  $confstr = '*';
787 
788  // Space assigned for the stubthreshold but unused
789  // since it disables the parser cache, its value will always
790  // be 0 when this function is called by parsercache.
791  if ( in_array( 'stubthreshold', $forOptions ) ) {
792  $confstr .= '!' . $this->mStubThreshold;
793  } else {
794  $confstr .= '!*';
795  }
796 
797  if ( in_array( 'dateformat', $forOptions ) ) {
798  $confstr .= '!' . $this->getDateFormat();
799  }
800 
801  if ( in_array( 'numberheadings', $forOptions ) ) {
802  $confstr .= '!' . ( $this->mNumberHeadings ? '1' : '' );
803  } else {
804  $confstr .= '!*';
805  }
806 
807  if ( in_array( 'userlang', $forOptions ) ) {
808  $confstr .= '!' . $this->mUserLang->getCode();
809  } else {
810  $confstr .= '!*';
811  }
812 
813  if ( in_array( 'thumbsize', $forOptions ) ) {
814  $confstr .= '!' . $this->mThumbSize;
815  } else {
816  $confstr .= '!*';
817  }
818 
819  // add in language specific options, if any
820  // @todo FIXME: This is just a way of retrieving the url/user preferred variant
821  if ( !is_null( $title ) ) {
822  $confstr .= $title->getPageLanguage()->getExtraHashOptions();
823  } else {
825  $confstr .= $wgContLang->getExtraHashOptions();
826  }
827 
828  $confstr .= $wgRenderHashAppend;
829 
830  // @note: as of Feb 2015, core never sets the editsection flag, since it uses
831  // <mw:editsection> tags to inject editsections on the fly. However, extensions
832  // may be using it by calling ParserOption::optionUsed resp. ParserOutput::registerOption
833  // directly. At least Wikibase does at this point in time.
834  if ( !in_array( 'editsection', $forOptions ) ) {
835  $confstr .= '!*';
836  } elseif ( !$this->mEditSection ) {
837  $confstr .= '!edit=0';
838  }
839 
840  if ( $this->mIsPrintable && in_array( 'printable', $forOptions ) ) {
841  $confstr .= '!printable=1';
842  }
843 
844  if ( $this->mExtraKey != '' ) {
845  $confstr .= $this->mExtraKey;
846  }
847 
848  // Give a chance for extensions to modify the hash, if they have
849  // extra options or other effects on the parser cache.
850  Hooks::run( 'PageRenderingHash', [ &$confstr, $this->getUser(), &$forOptions ] );
851 
852  // Make it a valid memcached key fragment
853  $confstr = str_replace( ' ', '_', $confstr );
854 
855  return $confstr;
856  }
857 
868  public function setupFakeRevision( $title, $content, $user ) {
869  $oldCallback = $this->setCurrentRevisionCallback(
870  function (
871  $titleToCheck, $parser = false ) use ( $title, $content, $user, &$oldCallback
872  ) {
873  if ( $titleToCheck->equals( $title ) ) {
874  return new Revision( [
875  'page' => $title->getArticleID(),
876  'user_text' => $user->getName(),
877  'user' => $user->getId(),
878  'parent_id' => $title->getLatestRevID(),
879  'title' => $title,
880  'content' => $content
881  ] );
882  } else {
883  return call_user_func( $oldCallback, $titleToCheck, $parser );
884  }
885  }
886  );
887 
889  $wgHooks['TitleExists'][] =
890  function ( $titleToCheck, &$exists ) use ( $title ) {
891  if ( $titleToCheck->equals( $title ) ) {
892  $exists = true;
893  }
894  };
895  end( $wgHooks['TitleExists'] );
896  $key = key( $wgHooks['TitleExists'] );
897  LinkCache::singleton()->clearBadLink( $title->getPrefixedDBkey() );
898  return new ScopedCallback( function () use ( $title, $key ) {
900  unset( $wgHooks['TitleExists'][$key] );
901  LinkCache::singleton()->clearLink( $title );
902  } );
903  }
904 }
static newFromContext(IContextSource $context)
Get a ParserOptions object from a IContextSource object.
Interface for objects which can provide a MediaWiki context on request.
$wgMaxArticleSize
Maximum article size in kilobytes.
callable $mTemplateCallback
Callback for template fetching; first argument to call_user_func().
$mIsSectionPreview
Parsing the page for a "preview" operation on a single section?
static legacyOptions()
Returns the full array of options that would have been used by in 1.16.
$wgAllowSpecialInclusion
Allow special page inclusions such as {{Special:Allpages}}.
disableTitleConversion($x=true)
$context
Definition: load.php:43
$mAllowExternalImagesFrom
If not, any exception?
$mMaxGeneratedPPNodeCount
Maximum number of nodes generated by Preprocessor::preprocessToObj()
$wgAllowExternalImagesFrom
If $wgAllowExternalImages is false, you can allow an on-wiki whitelist of regular expression fragment...
$mDateFormat
Date format index.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
$wgExpensiveParserFunctionLimit
Maximum number of calls per parse to expensive parser functions such as PAGESINCATEGORY.
$mIsPreview
Parsing the page for a "preview" operation?
Set options of the Parser.
if(!isset($args[0])) $lang
setAllowSpecialInclusion($x)
static newFromUserAndLang(User $user, Language $lang)
Get a ParserOptions object from a given user and language.
initialiseFromUser($user, $lang)
Get user options.
setupFakeRevision($title, $content, $user)
Sets a hook to force that a page exists, and sets a current revision callback to return a revision wi...
$mExternalLinkTarget
Target attribute for external links.
setSpeculativeRevIdCallback($x)
$wgHooks['ArticleShow'][]
Definition: hooks.txt:110
when a variable name is used in a it is silently declared as a new local masking the global
Definition: design.txt:93
static newFromUser($user)
Get a ParserOptions object from a given user.
User $mUser
Stored user object.
magic word & $parser
Definition: hooks.txt:2372
Title null $redirectTarget
If the page being parsed is a redirect, this should hold the redirect target.
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
$mStubThreshold
Maximum article size of an article to be marked as "stub".
$mTimestamp
Timestamp used for {{CURRENTDAY}} etc.
The User object encapsulates all of the user-specific settings (user_id, name, rights, email address, options, last login time).
Definition: User.php:47
callable null $mSpeculativeRevIdCallback
Callback to generate a guess for {{REVISIONID}}.
$mMaxTemplateDepth
Maximum recursion depth for templates within templates.
$mTargetLanguage
Overrides $mInterfaceMessage with arbitrary language.
getUser()
Get the User object.
Class for asserting that a callback happens when an dummy object leaves scope.
$wgRenderHashAppend
Append a configured value to the parser cache and the sitenotice key so that they can be kept separat...
static singleton()
Get an instance of this class.
Definition: LinkCache.php:65
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database key
Definition: design.txt:25
$mRemoveComments
Remove HTML comments.
$mAllowSpecialInclusion
Allow inclusion of special pages?
$mCleanSignatures
Clean up signature texts?
setEnableImageWhitelist($x)
registerWatcher($callback)
Registers a callback for tracking which ParserOptions which are used.
getRedirectTarget()
Get the previously-set redirect target.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
callable $mCurrentRevisionCallback
Callback for current revision fetching; first argument to call_user_func().
Internationalisation code.
Definition: Language.php:39
$mMaxPPNodeCount
Maximum number of nodes touched by PPFrame::expand()
$mIsPrintable
Parsing the printable version of the page?
getUserLangObj()
Get the user language used by the parser for this page and split the parser cache.
$mPreSaveTransform
Transform wiki markup when saving the page?
$wgDisableTitleConversion
Whether to enable language variant conversion for links.
$mInterfaceMessage
Which lang to call for PLURAL and GRAMMAR.
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead.&$feedLinks conditions will AND in the final query as a Content object as a Content object $title
Definition: hooks.txt:312
$wgInterwikiMagic
Treat language links as magic connectors, not inline links.
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:131
getUserLang()
Same as getUserLangObj() but returns a string instead.
setAllowExternalImages($x)
getLanguage()
Get the Language object.
$mDisableTitleConversion
Whether title conversion should be disabled.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
$wgDisableLangConversion
Whether to enable language variant conversion.
static newFromAnon()
Get a ParserOptions object for an anonymous 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 local account $user
Definition: hooks.txt:242
setRedirectTarget($title)
Set the redirect target.
$mInterwikiMagic
Interlanguage links are removed and returned in an array.
disableContentConversion($x=true)
$mExpensiveParserFunctionLimit
Maximum number of calls per parse to expensive parser functions.
setAllowExternalImagesFrom($x)
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
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...
$mMaxIncludeSize
Maximum size of template expansions, in bytes.
$onAccessCallback
Function to be called when an option is accessed.
$mDisableContentConversion
Whether content conversion should be disabled.
$mExtraKey
Extra key that should be present in the caching key.
$mEnableLimitReport
Enable limit report in an HTML comment on output.
enableLimitReport($x=true)
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
Definition: hooks.txt:1020
setMaxGeneratedPPNodeCount($x)
$mUserLang
Language object of the User language.
$mMaxPPExpandDepth
Maximum recursion depth in PPFrame::expand()
addExtraKey($key)
Extra key that should be present in the parser cache key.
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 local content language as $wgContLang
Definition: design.txt:56
$mEditSection
Create "edit section" links?
$mAllowExternalImages
Allow external images inline?
$wgEnableImageWhitelist
If $wgAllowExternalImages is false, you can allow an on-wiki whitelist of regular expression fragment...
static factory($code)
Get a cached or new language object for a given language code.
Definition: Language.php:179
$wgExternalLinkTarget
Set a default target for external links, e.g.
$mTidy
Use tidy to cleanup output HTML?
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.
$mEnableImageWhitelist
If not or it doesn't match, should we check an on-wiki whitelist?
setCurrentRevisionCallback($x)
__construct($user=null, $lang=null)
Constructor.
static isRealObject($obj)
Returns a bool value whenever $obj is a stub object.
Definition: StubObject.php:74
setExpensiveParserFunctionLimit($x)
optionUsed($optionName)
Called when an option is accessed.
matches(ParserOptions $other)
Check if these options match that of another options set.
$wgUser
Definition: Setup.php:801
$mNumberHeadings
Automatically number headings?
getExpensiveParserFunctionLimit()