Changes to the use statements done automatically via script
Addition of missing use statements done manually
Change-Id: Iad87245bf8082193be72f7e482f29e9f1bad11fc
Use
$this->getServiceContainer()
instead of
MediaWikiServices::getInstance()
in maintenance and tests.
Change-Id: I845e8f083b19da093166d6551683f2013eec7bb1
Switch the callers to the standard Maintenance::waitForReplication() method.
Avoid using LoadBalancer::waitFor(), which will made internal soon.
Bug: T326274
Change-Id: Idf0562eb33d90ff70eb3a7d5d7f54da944423d27
Moved the factory deeper into the code right before the one usage it
still needed a full user object
Narrow done method arguments from User to UserIdentity
and use the identity directly
Change-Id: Ic118f23ef504c7fda892480df61ea68c10915f78
The global function wfWikiID() is deprecated since 1.35 and it's usages
should be replaced with WikiMap::getCurrentWikiId().
Bug: T298059
Change-Id: Ia8cbc992eb80ee6d531cf11bdf2bc06181bce8b0
Phan says:
maintenance/backfillUnreadWikis.php:51 PhanTypeMismatchArgumentNullable Argument 1 ($userIdentity) is $lookup->localUserFromCentralId($row->euw_user, CentralIdLookup::AUDIENCE_RAW) of type ?\MediaWiki\DAO\WikiAwareEntity|?\MediaWiki\User\UserIdentity but \MediaWiki\User\UserFactory::newFromUserIdentity() takes \MediaWiki\User\UserIdentity defined at ../../includes/user/UserFactory.php:166 (expected type to be non-nullable)
Follow-up to 64531785a6.
Change-Id: I261e87d16bc23e9f1b5d3385553c5899632c9127
The $cached and $dbSource parameters are now unused, so remove them.
This affects get{Notification,Alert,Message}Count and
getLastUnread{Notification,Alert,Message}Time.
There are some callers in other extensions and in skins, but none of
them pass any parameters (except one, which I fixed in Ice42930280da).
Change-Id: If6f10c4f163ecb1def5a150656a60d1ab5f44d52
As suggested in 26505b170adb24a6ae68945920db322c9382e470 for better
readability. Also the sniff now knows about the maintenance script
Change-Id: If3ab122c1fc12fcfbce777881ca21ecd99fb2a70
Various selectFields() methods were deprecated in MediaWiki core change
Idcfd1556, replaced with getQueryInfo() methods.
Change-Id: I5d62ad76fdb64a9c6efd228f27e9b5f512f17d5e
Depends-On: Idcfd15568489d9f03a7ba4460e96610d33bc4089
In rebuild mode, we only process users who already have
a row in the euw table. This reduces the number of users
we have to process significantly. Thanks to Stephane
for this idea.
Also, don't force a recache of the alert and message counts,
it's OK to fetch them from cache. We also don't need to invalidate
any caches in this script, because the transition flag from
Ibcc8ac102 will ensure that the cached global counts are
correct.
Change-Id: I69c54cac47468647df2778b2d82f1b5dd9e574d3
Better idea: invalidate caches in this script, and write
a separate script to recompute existing euw rows.
This reverts commit c83af257d2.
Change-Id: I57bccfb726eada646cb318206d9091a20d59dcf5
This causes it to update the notification count cache as well.
Should we perhaps rename it to recacheNotificationCounts.php?
Bug: T132954
Change-Id: I540c4296f4fbadcf2267d77b53f71ee5c2eb8b52
Previously, getNotificationCount() only looked at local notifications,
and foreign notifications were added in separately by getMessageCount()
and getAlertCount(). This didn't make any sense and resulted in
counter-intuitive things like I4d49b543.
Instead, add a $global flag to getNotificationCount(). If $global=false,
the local count is returned as before, but if $global=true, the
global count (=local+foreign) is returned. If $global is omitted,
the user's cross-wiki notification preference determines which is returned.
Update getLastUnreadNotificationCount() in the same way, since it had
the same issues.
Also add caching for global counts and timestamps, using a global
memc key.
Bug: T133623
Change-Id: If78bfc710acd91a075771b565cc99f4c302a104d