X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParserOptions.php;h=96a43682585061a3327b7e5dce47af14e77d41dd;hb=cc0d030a96f9635a7da24cd3e6c42177a3bd100d;hp=4809917b631f9c817c3e79041f63a08ce4d905e7;hpb=1c0d9ba2e8e35c361ca94cdc75e4015542dda3a6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 4809917b63..96a4368258 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -1211,10 +1211,11 @@ class ParserOptions { * Returns the full array of options that would have been used by * in 1.16. * Used to get the old parser cache entries when available. - * @todo 1.16 was years ago, can we remove this? + * @deprecated since 1.30. You probably want self::allCacheVaryingOptions() instead. * @return array */ public static function legacyOptions() { + wfDeprecated( __METHOD__, '1.30' ); return [ 'stubthreshold', 'numberheadings', @@ -1225,6 +1226,20 @@ class ParserOptions { ]; } + /** + * Return all option keys that vary the options hash + * @since 1.30 + * @return string[] + */ + public static function allCacheVaryingOptions() { + // Trigger a call to the 'ParserOptionsRegister' hook if it hasn't + // already been called. + if ( self::$defaults === null ) { + self::getDefaults(); + } + return array_keys( array_filter( self::$inCacheKey ) ); + } + /** * Convert an option to a string value * @param mixed $value