From: Brad Jorsch Date: Thu, 27 Aug 2015 13:38:53 +0000 (-0400) Subject: Make ParserOptions fields private X-Git-Tag: 1.31.0-rc.0~10236^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=877c3db39636f01ae0c607b1fa407ce70a2b4ed9;p=lhc%2Fweb%2Fwiklou.git Make ParserOptions fields private Now that Ib58e8020 and Ie644854 are merged, there are no direct accesses to these fields left in core or extensions in Gerrit. So let's make them private to make sure no more get added before we decide whether we're going to eliminate them entirely. Bug: T110269 Change-Id: I82041b88dd0f194716f54d3207649388328805ca --- diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26 index fd21c4c16b..14d6c5801e 100644 --- a/RELEASE-NOTES-1.26 +++ b/RELEASE-NOTES-1.26 @@ -26,6 +26,7 @@ production. This experimental feature was never enabled by default and is obsolete as of MediaWiki 1.26, in where ResourceLoader became fully asynchronous. * $wgMasterWaitTimeout was removed (deprecated in 1.24). +* Fields in ParserOptions are now private. Use the accessors instead. === New features in 1.26 === * (T51506) Now action=info gives estimates of actual watchers for a page. diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index ed0d74a3fb..e4c867ae79 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -34,145 +34,145 @@ class ParserOptions { /** * Interlanguage links are removed and returned in an array */ - public $mInterwikiMagic; + private $mInterwikiMagic; /** * Allow external images inline? */ - public $mAllowExternalImages; + private $mAllowExternalImages; /** * If not, any exception? */ - public $mAllowExternalImagesFrom; + private $mAllowExternalImagesFrom; /** * If not or it doesn't match, should we check an on-wiki whitelist? */ - public $mEnableImageWhitelist; + private $mEnableImageWhitelist; /** * Date format index */ - public $mDateFormat = null; + private $mDateFormat = null; /** * Create "edit section" links? */ - public $mEditSection = true; + private $mEditSection = true; /** * Allow inclusion of special pages? */ - public $mAllowSpecialInclusion; + private $mAllowSpecialInclusion; /** * Use tidy to cleanup output HTML? */ - public $mTidy = false; + private $mTidy = false; /** * Which lang to call for PLURAL and GRAMMAR */ - public $mInterfaceMessage = false; + private $mInterfaceMessage = false; /** * Overrides $mInterfaceMessage with arbitrary language */ - public $mTargetLanguage = null; + private $mTargetLanguage = null; /** * Maximum size of template expansions, in bytes */ - public $mMaxIncludeSize; + private $mMaxIncludeSize; /** * Maximum number of nodes touched by PPFrame::expand() */ - public $mMaxPPNodeCount; + private $mMaxPPNodeCount; /** * Maximum number of nodes generated by Preprocessor::preprocessToObj() */ - public $mMaxGeneratedPPNodeCount; + private $mMaxGeneratedPPNodeCount; /** * Maximum recursion depth in PPFrame::expand() */ - public $mMaxPPExpandDepth; + private $mMaxPPExpandDepth; /** * Maximum recursion depth for templates within templates */ - public $mMaxTemplateDepth; + private $mMaxTemplateDepth; /** * Maximum number of calls per parse to expensive parser functions */ - public $mExpensiveParserFunctionLimit; + private $mExpensiveParserFunctionLimit; /** * Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS */ - public $mRemoveComments = true; + private $mRemoveComments = true; /** * Callback for current revision fetching. Used as first argument to call_user_func(). */ - public $mCurrentRevisionCallback = + private $mCurrentRevisionCallback = array( 'Parser', 'statelessFetchRevision' ); /** * Callback for template fetching. Used as first argument to call_user_func(). */ - public $mTemplateCallback = + private $mTemplateCallback = array( 'Parser', 'statelessFetchTemplate' ); /** * Enable limit report in an HTML comment on output */ - public $mEnableLimitReport = false; + private $mEnableLimitReport = false; /** * Timestamp used for {{CURRENTDAY}} etc. */ - public $mTimestamp; + private $mTimestamp; /** * Target attribute for external links */ - public $mExternalLinkTarget; + private $mExternalLinkTarget; /** * Clean up signature texts? * @see Parser::cleanSig */ - public $mCleanSignatures; + private $mCleanSignatures; /** * Transform wiki markup when saving the page? */ - public $mPreSaveTransform = true; + private $mPreSaveTransform = true; /** * Whether content conversion should be disabled */ - public $mDisableContentConversion; + private $mDisableContentConversion; /** * Whether title conversion should be disabled */ - public $mDisableTitleConversion; + private $mDisableTitleConversion; /** * Automatically number headings? */ - public $mNumberHeadings; + private $mNumberHeadings; /** * Thumb size preferred by the user. */ - public $mThumbSize; + private $mThumbSize; /** * Maximum article size of an article to be marked as "stub" @@ -182,38 +182,38 @@ class ParserOptions { /** * Language object of the User language. */ - public $mUserLang; + private $mUserLang; /** * @var User * Stored user object */ - public $mUser; + private $mUser; /** * Parsing the page for a "preview" operation? */ - public $mIsPreview = false; + private $mIsPreview = false; /** * Parsing the page for a "preview" operation on a single section? */ - public $mIsSectionPreview = false; + private $mIsSectionPreview = false; /** * Parsing the printable version of the page? */ - public $mIsPrintable = false; + private $mIsPrintable = false; /** * Extra key that should be present in the caching key. */ - public $mExtraKey = ''; + private $mExtraKey = ''; /** * Function to be called when an option is accessed. */ - protected $onAccessCallback = null; + private $onAccessCallback = null; /** * If the page being parsed is a redirect, this should hold the redirect