Daimona added a comment.

  In T241947#5802594 <https://phabricator.wikimedia.org/T241947#5802594>, 
@Addshore wrote:
  
  > Well, RequestContext::getMain is slightly less evil that the global 
probably.
  
  Yeah, well, a little bit... I believe the only difference is that, when using 
RequestContext, any piece of code writing to $wgUser and 
RequestContext::getMain only has to write to the latter. Aside from this, 
they're the same thing 
<https://gerrit.wikimedia.org/g/mediawiki/core/+/0ff789715c7e9d4a560bf26242072ad4cb2aea10/includes/Setup.php#837>.
  
  > So I'd go for lets just make that patch and hen resolve this task for now :)
  > If someone wants to get rid of RequestContext::getMain then that is a whole 
different kettle of fish to tackle later down the line.
  
  Sure :) In places where a User object can be injected, I believe that it's 
not worth it to use RequestContext::getMain now, and replace it with proper DI 
later. But, where there's no clear way to inject a User, I think 
RequestContext::getMain is acceptable.

TASK DETAIL
  https://phabricator.wikimedia.org/T241947

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Daimona
Cc: Addshore, Daimona, Aklapper, Chaytanya, darthmon_wmde, DannyS712, Nandana, 
Kieubinhtb, Guilhermebm, Mh-3110, Amorymeltzer, Asad_Ali_Palijo, Lahi, Gq86, 
GoranSMilovanovic, Soteriaspace, RazeSoldier, Jayprakash12345, 
JakeTheDeveloper, QZanden, LawExplorer, _jensen, rosalieper, D3r1ck01, 
Scott_WUaS, Jonas, MuhammadShuaib, Izno, MGChecker, Tmalhotra, SimmeD, 
Wikidata-bugs, aude, Dinoguy1000, Lydia_Pintscher, Mbch331, Jay8g
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to