Use should be removed
|Open||None||T11968 Reduce use of global and public variables|
|Open||None||T159283 Deprecate non-configuration globals|
|Open||DannyS712||T159299 Deprecate and remove $wgUser|
|Open||None||T267861 [GOAL] Emit deprecation warnings reading from $wgUser|
|Open||DannyS712||T243708 Mediawiki core needs uses of global $wgUser removed|
|Open||DannyS712||T242935 Deprecate core fallbacks to $wgUser|
|Resolved||DannyS712||T254702 GenderCache::getGenderOf uses $wgUser|
$wgUser is used to avoid a cache miss for the current user and return the value from the user object instead.
It could also be possible to inject/call that ealier into the cache to avoid that it is requested the first time after the cache is full.
But that would mean the cache is created on each request, which seems not a good idea
Have no idea how to avoid the request context at all here.