BookManager v2: Use an IContextSource instead of globals
completed by: Thomas Lam
mentors: Quim Gil, Raylton P. Sousa, Kunal Mehta
Bug 52347 - Use an IContextSource instead of globals
That function uses $wgLang and $wgUser, which are evil globals. Each parent caller (through various functions) provides context, which is some object that implements IContextSource. The code should simply pass the context down and use $context->getLanguage() and $context->getUser() instead of relying on globals.
Find the details in the bug report above. You can also ask any questions there, where not only GCI mentors but also the maintainers of the application can help you.