The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Usage.ForbiddenFunctions.isset
* MediaWiki.Usage.PHPUnitDeprecatedMethods.AssertInternalTypeGeneric
Additional changes:
* Also sorted "composer fix" command to run phpcbf last.
Change-Id: I29416247ff3736799543926813beaf4afd569a6e
PHP doesn't care much about the name (in terms of case sensitivity)
but I think we should make sure the names of the method should be as
they're in their definition.
Change-Id: I6e38d8be64efaec4200471f2d3007275d7ddecec
Class Revision is deprecated and in this patch, replaces
usage with appropriate classes; RevisionRecord, RevisionStore,
etc.
Bug: T221163
Change-Id: Icfc85167a636bef95daab236ab80113c1a3cf41b
Remove echo_target_page rows associated with the echo_event rows we're
deleting, and also add a separate pass that removes any remaining
orphaned echo_target_page rows (this can happen if the script was run on
the wiki before this logic was added).
Bug: T221261
Change-Id: Ic3b590fb3ac3de4c2e38877d26944367b177235a
Generally applicable, but intended for users affected by the
login-success phantom notifications bug.
Bug: T220762
Change-Id: Ica428bfc19e0555564ca04d80ac5009197401aaf
echo_notification isn't the only table that refers to echo_event;
echo_email_batch does too, so check it as well.
Change-Id: I6663c8bb83a991ee663eb1616583fde8eee46751
No longer used in the new bundling system.
Also removes indexes that contain bundle_base.
Bug: T143763
Bug: T131415
Change-Id: Ibf94cdc471a11cb14995fee6a55af0d227b50aa5
By running updateEchoSchemaForSuppression.php as an updater.
The patch-*.sql files already existed, they were added
in 2013(!) by 34fbeaf8c but never applied.
Bug: T136427
Bug: T50059
Change-Id: Ied049681df4bab325f069c3a68cf704ee9a8f2c9
This codebase already used the …::class feature a lot. This is more
about making the code consistent and easier to refactor in the future.
Change-Id: If5b2456b825aae753ed97445160ec191c18df8e3
* preg_match_all already returns the number of matches. We can just use
this number instead of counting it.
* Checking for a strlen() of 0 is a little tooo expressive, because we
don't really care about the actual length of the string.
Change-Id: I0537a7740e5d369b79364f24aecf71c4e8fa7db1
array_shift manipulates the original array. This is surprisingly
expensive, because it iterates *all* elements in the array and
decrements numeric keys. The code touched in this patch does not need
this restructured new array, but only the individual elements.
Change-Id: I166fdbe199400611a21cbd608dd3e177336c8fd5
Use the ExtensionRegistry instead of checking the existence
of a specific class to know if an extension is installed.
Improve logging, including line break, when an extension
is not installed.
Change-Id: Ia81194392ffc65abc8ad150b36b468315a1a67c3
Specify which notification types allow notifying the event agent in
$wgEchoNotifications, and stop specifying it in the event_extra data.
Putting 'notifyAgent' => true in event_extra will still work, but is
discouraged.
Change-Id: I4f558654ec23757dd4ecd6986eb3e9a5593f5386
I found this code while looking for possibly problematic count()s.
I noticed the line "$user = $pageData['revisions'][0]…", which means
the code assumes element [0] is always there. Therefore I droped the
"count() == 1" check.
The other count() got replaced with an isset().
Change-Id: Ic582c85d07db0cbed56512e3e381120b628f2288
If all the code needs to know is if an array is empty or not, using
count() creates more confusion than anything.
Change-Id: I253308505fe5af5b5c56d85169789271967298ba
Add the ability to create notifications with specific timestamps
when generating notifications through the maintenance script.
Note, that not all notifications can be given specific timestamp;
only notifications that do not involve a direct editing action
will be given this timestamp and their events will be created
as if the actions were taken at the given timestamp, with
1 minute intervals.
Change-Id: I9e6b8660178ca0734979946c8e6ec8d43fc3de41
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
Format user-rights reason as plain text
in both web and email since links
in notification body are not supported.
Bug: T172636
Change-Id: Ief5ff0aff18aad070f4388e075b5aae072d8f101
The centralIdsFromNames() includes optimizations and error checking
that was not in the original version.
Bug: T178313
Change-Id: I3d6334f2e81f3cee66b36690734f70958fdcefdb
Various selectFields() methods were deprecated in MediaWiki core change
Idcfd1556, replaced with getQueryInfo() methods.
Change-Id: I5d62ad76fdb64a9c6efd228f27e9b5f512f17d5e
Depends-On: Idcfd15568489d9f03a7ba4460e96610d33bc4089
To access user_properties in the WMF cluster, we must use the standard database connection instead of the echo connection.
Bug: T173475
Change-Id: Ic7344e4521b30055f7986aefd61712e6c6a0052c
The echo mute list uses user names which are not stable. User ids should be used instead.
Bug: T173475
Change-Id: I947bcf37a8f85aaa105776d368dbd0ab76823aeb
Follow-up to Id539a7db8d8f5e902177845bd212b4d6c2500f89
Pass the revision id instead of populating the request
object.
Change-Id: I4567d8b08999558d86c48aea5912de0e52bcf241