GSoC/GCI Archive
Google Code-in 2013 Wikimedia

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

See https://gerrit.wikimedia.org/r/#/c/76454/4/BookManagerv2.hooks.php
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.

Background:

https://www.mediawiki.org/wiki/Extension:BookManager

https://git.wikimedia.org/summary/?r=mediawiki/extensions/BookManagerv2.git

Students are required to read Wikimedia's general instructions first. Patches should be submitted to Gerrit and reference the bug report in the commit message.