/**
* 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
* @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 );
}
/**