Last modified: 2014-08-11 17:33:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T50963, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48963 - mark $wgUser as deprecated using DeprecatedGlobals.php
mark $wgUser as deprecated using DeprecatedGlobals.php
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.22.0
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-30 10:17 UTC by Antoine "hashar" Musso (WMF)
Modified: 2014-08-11 17:33 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
FB preview (65.08 KB, image/png)
2013-06-17 13:59 UTC, Nemo
Details

Description Antoine "hashar" Musso (WMF) 2013-05-30 10:17:06 UTC
Tim said we can phase out $wgUser in favor of RequestContext::getMain()->getUser()

https://www.facebook.com/brionv/posts/10151391376376852

We could use a PHP CodeSniffer sniff to report $wgUser should be replaced.
Comment 1 Krinkle 2013-06-01 01:09:10 UTC
Don't we already have a deprecation system in general? (both for methods and for globals). How is phpcs relevant?

With the proper configuration, accessing deprecated methods or globals, a PHP error is emitted.
Comment 2 Antoine "hashar" Musso (WMF) 2013-06-01 20:31:37 UTC
And what is the "proper" configuration to react whenever $wgUser is referenced / accessed ?
Comment 3 Krinkle 2013-06-03 20:01:12 UTC
(In reply to comment #2)
> And what is the "proper" configuration to react whenever $wgUser is
> referenced / accessed ?

The proper solution is to assert that no php errors/notices are emitted during our running of the installer, php unit tests and http requests.

Marking as wontfix and suggest further discussion be at bug 48002.
Comment 4 Antoine "hashar" Musso (WMF) 2013-06-04 12:05:30 UTC
Timo that is not covering everything.  We want to get rid of $wgUser and the easiest is to detect whether it is used in the code, a sniff is a trivial thing to add in.
Comment 5 Gerrit Notification Bot 2013-06-17 13:36:06 UTC
Related URL: https://gerrit.wikimedia.org/r/69090 (Gerrit Change Ic3d5f082afefe761a24ab0822859a9ef88c61e02)
Comment 6 Nemo 2013-06-17 13:59:34 UTC
Created attachment 12564 [details]
FB preview

(In reply to comment #0)
> https://www.facebook.com/brionv/posts/10151391376376852

Attaching for posterity's sake.
Comment 7 Antoine "hashar" Musso (WMF) 2013-07-10 08:50:08 UTC
Umherirrender notified on the change:
-----
There is a DeprecatedGlobals.php to get deprecation warnings on a global (used for $wgArticle), but $wgUser is not deprecated at the moment, so this is only for a hint to the developer and should not be a blocking sniff.
-----

So I guess that needs to be done directly in core instead of phpcs as Timo pointed out.  Moving bugs under MediaWiki product.
Comment 8 Gerrit Notification Bot 2013-07-10 08:50:57 UTC
Change 69090 abandoned by Hashar:
Implement DeprecatedGlobalSniff for $wgUser

Reason:
I do not knew about DeprecatedGlobals.php seems it would get the job done.  I have moved the bug report https://bugzilla.wikimedia.org/show_bug.cgi?id=48963 under MediaWiki product.

https://gerrit.wikimedia.org/r/69090
Comment 9 Antoine "hashar" Musso (WMF) 2014-05-06 15:50:06 UTC
There is no patch pending. Reseting bug status.
Comment 10 Addshore 2014-08-11 17:31:49 UTC
What is this DeprecatedGlobals.php file?
Comment 11 Addshore 2014-08-11 17:33:06 UTC
The following patch is probably rather relevant.
https://gerrit.wikimedia.org/r/#/c/153399/

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links