Merge "Added a separate error message for mkdir failures"
[lhc/web/wiklou.git] / includes / parser / ParserOptions.php
index 4809917..73a9927 100644 (file)
@@ -927,7 +927,6 @@ class ParserOptions {
        }
 
        /**
-        * Constructor
         * @warning For interaction with the parser cache, use
         *  WikiPage::makeParserOptions(), ContentHandler::makeParserOptions(), or
         *  ParserOptions::newCanonical() instead.
@@ -1211,10 +1210,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 +1225,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