Merge "registration: Use the correct key for skin dependencies"
[lhc/web/wiklou.git] / includes / content / ContentHandler.php
index 3c5ee26..79bbba8 100644 (file)
@@ -1114,6 +1114,8 @@ abstract class ContentHandler {
        /**
         * Get parser options suitable for rendering and caching the article
         *
+        * @deprecated since 1.32, use WikiPage::makeParserOptions() or
+        *  ParserOptions::newCanonical() instead.
         * @param IContextSource|User|string $context One of the following:
         *        - IContextSource: Use the User and the Language of the provided
         *                                            context
@@ -1126,22 +1128,8 @@ abstract class ContentHandler {
         * @return ParserOptions
         */
        public function makeParserOptions( $context ) {
-               global $wgContLang;
-
-               if ( $context instanceof IContextSource ) {
-                       $user = $context->getUser();
-                       $lang = $context->getLanguage();
-               } elseif ( $context instanceof User ) { // settings per user (even anons)
-                       $user = $context;
-                       $lang = null;
-               } elseif ( $context === 'canonical' ) { // canonical settings
-                       $user = new User;
-                       $lang = $wgContLang;
-               } else {
-                       throw new MWException( "Bad context for parser options: $context" );
-               }
-
-               return ParserOptions::newCanonical( $user, $lang );
+               wfDeprecated( __METHOD__, '1.32' );
+               return ParserOptions::newCanonical( $context );
        }
 
        /**