X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParserOptions.php;h=7c6dde6b9f9c0994741c029e736b36692c193485;hb=eb5b9b2e38fffac4952f8f7893595ab346902111;hp=8393216875552cbf65b3be24ef6dbf586dc6df81;hpb=4960dd9b775b4f7aae2e1f1906a1f72b859415df;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 8393216875..7c6dde6b9f 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -164,11 +164,6 @@ class ParserOptions { */ var $mNumberHeadings; - /** - * User math preference (as integer). Not used (1.19) - */ - var $mMath; - /** * Thumb size preferred by the user. */ @@ -240,9 +235,6 @@ class ParserOptions { function getExternalLinkTarget() { return $this->mExternalLinkTarget; } function getDisableContentConversion() { return $this->mDisableContentConversion; } function getDisableTitleConversion() { return $this->mDisableTitleConversion; } - /** @deprecated since 1.22 use User::getOption('math') instead */ - function getMath() { $this->optionUsed( 'math' ); - return $this->mMath; } function getThumbSize() { $this->optionUsed( 'thumbsize' ); return $this->mThumbSize; } function getStubThreshold() { $this->optionUsed( 'stubthreshold' ); @@ -255,16 +247,6 @@ class ParserOptions { function getUser() { return $this->mUser; } function getPreSaveTransform() { return $this->mPreSaveTransform; } - /** - * @param $title Title - * @return Skin - * @deprecated since 1.18 Use Linker::* instead - */ - function getSkin( $title = null ) { - wfDeprecated( __METHOD__, '1.18' ); - return new DummyLinker; - } - function getDateFormat() { $this->optionUsed( 'dateformat' ); if ( !isset( $this->mDateFormat ) ) { @@ -339,8 +321,6 @@ class ParserOptions { function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); } function disableContentConversion( $x = true ) { return wfSetVar( $this->mDisableContentConversion, $x ); } function disableTitleConversion( $x = true ) { return wfSetVar( $this->mDisableTitleConversion, $x ); } - /** @deprecated since 1.22 */ - function setMath( $x ) { return wfSetVar( $this->mMath, $x ); } function setUserLang( $x ) { if ( is_string( $x ) ) { $x = Language::factory( $x ); @@ -451,7 +431,6 @@ class ParserOptions { $this->mUser = $user; $this->mNumberHeadings = $user->getOption( 'numberheadings' ); - $this->mMath = $user->getOption( 'math' ); $this->mThumbSize = $user->getOption( 'thumbsize' ); $this->mStubThreshold = $user->getStubThreshold(); $this->mUserLang = $lang; @@ -469,8 +448,9 @@ class ParserOptions { /** * Called when an option is accessed. + * @param string $optionName name of the option */ - protected function optionUsed( $optionName ) { + public function optionUsed( $optionName ) { if ( $this->onAccessCallback ) { call_user_func( $this->onAccessCallback, $optionName ); } @@ -483,7 +463,7 @@ class ParserOptions { * @return array */ public static function legacyOptions() { - return array( 'math', 'stubthreshold', 'numberheadings', 'userlang', 'thumbsize', 'editsection', 'printable' ); + return array( 'stubthreshold', 'numberheadings', 'userlang', 'thumbsize', 'editsection', 'printable' ); } /** @@ -505,13 +485,10 @@ class ParserOptions { public function optionsHash( $forOptions, $title = null ) { global $wgRenderHashAppend; - $confstr = ''; - - if ( in_array( 'math', $forOptions ) ) { - $confstr .= $this->mMath; - } else { - $confstr .= '*'; - } + // FIXME: Once the cache key is reorganized this argument + // can be dropped. It was used when the math extension was + // part of core. + $confstr = '*'; // Space assigned for the stubthreshold but unused // since it disables the parser cache, its value will always @@ -571,7 +548,7 @@ class ParserOptions { // Give a chance for extensions to modify the hash, if they have // extra options or other effects on the parser cache. - wfRunHooks( 'PageRenderingHash', array( &$confstr ) ); + wfRunHooks( 'PageRenderingHash', array( &$confstr, $this->getUser(), &$forOptions ) ); // Make it a valid memcached key fragment $confstr = str_replace( ' ', '_', $confstr );