From 37e30d27a3bbeea0b2acc1f381efe3cbfaa9c8ef Mon Sep 17 00:00:00 2001 From: aude Date: Thu, 20 Aug 2015 18:03:52 +0200 Subject: [PATCH] Add comments for ParserOptions::getUserLang regarding cache split Add details in comments for ParserOptions::getUserLang, more explicitly warning about cache fragmentation and mention that in some cases (e.g. multilingual wiki) this might be desired. Change-Id: I3fe0799ade488eca32d8c89150179710309650c3 --- includes/parser/ParserOptions.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 100656d1e2..ed0d74a3fb 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -372,13 +372,15 @@ class ParserOptions { } /** - * Get the user language used by the parser for this page. + * Get the user language used by the parser for this page and record the + * userlang parser option, which splits parser cache. * * You shouldn't use this. Really. $parser->getFunctionLang() is all you need. * * To avoid side-effects where the page will be rendered based on the language - * of the user who last saved, this function will triger a cache fragmentation. - * Usage of this method is discouraged for that reason. + * of the user who last saved, this function will trigger a cache fragmentation. + * For that reason, usage of this method is discouraged unless it is desired to + * split caches based on user language, such as for multilingual content. * * When saving, this will return the default language instead of the user's. * -- 2.20.1