Commit graph

136 commits

Author SHA1 Message Date
James D. Forrester 4dd2a651e1 phpcs: Auto-fix MediaWiki.Usage.StaticClosure.StaticClosure
Change-Id: I6a02902ffaa8a9b497d60b573a0b8e3dbc207ee5
2021-05-04 09:06:42 -07:00
libraryupgrader b3f948c59c build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Change-Id: I4b2fb7f46b6c0a5c33a6ad25f085de8ae13eb084
2021-05-04 09:05:15 -07:00
vladshapik 325f542d9c Avoid using User::addGroup
Remove using of User::addGroup since this method will be hard-deprecated. Now it is soft-deprecated

Bug: T276094
Change-Id: Ib074ca906d31a02ca241296b32416ffb30e90e4f
2021-03-01 17:01:31 +02:00
jenkins-bot c5ff8a20d1 Merge "Use Maintenance::set/getBatchSize in maintenance scripts" 2020-12-31 23:20:47 +00:00
jenkins-bot 6042d6e389 Merge "Prefer UserIdentity::isRegistered over isAnon" 2020-12-23 08:25:04 +00:00
Thiemo Kreuz c9797db768 Prefer UserIdentity::isRegistered over isAnon
isRegistered is part of the slick UserIdentity interface, i.e.
it's the more "canonical" form. This change makes it a bit
easier to move away from using the huge (4000+ LOC) User class
everywhere, in favor of the UserIdentity interface, where
possible.

This patch is meant as a small step towards this goal. I tried
to replace some usages of User type hints already, but prefer
to go in small, incremental steps.

Change-Id: I039c7a18672dfb6ea9507752bce9ea754babd690
2020-12-23 07:15:30 +00:00
Umherirrender ceac7e38d7 Use Maintenance::set/getBatchSize in maintenance scripts
No need to define own class property

Change-Id: I9c71eaee6086b3d079648ee8dba41b7600c464a1
2020-12-18 00:28:32 +01:00
Umherirrender d7556b1d96 Add missing @var and improve documentation
Change-Id: I729d5ff5afd4d45022fa0a4e42d060d35543b567
2020-12-17 20:55:49 +01:00
libraryupgrader b391178348 build: Updating mediawiki/mediawiki-phan-config to 0.10.5
Change-Id: I8892cea01993f0ae51eebabaaf40685889124943
2020-12-10 18:20:15 +00:00
libraryupgrader 7c384798be build: Updating mediawiki/mediawiki-phan-config to 0.10.4
Change-Id: I3c21277a70107abf70599da2c3a4de194c6aad58
2020-11-20 13:56:13 +00:00
Reedy 257de880c1 Make use of BatchRow(Iterator|Writer)::setCaller
Bug: T261014
Change-Id: I51df93a9ed998c25e632c35b0fcc531615ddfb80
2020-09-05 03:45:55 +00:00
Umherirrender 3c53d6acb9 phpcs: Break long lines
Use the codesniffer default of length = 120

Change-Id: Ifbfd56b20432e54805d3a9bce22cda888c1fc74d
2020-06-27 12:05:03 +02:00
jenkins-bot c82226835b Merge "s/slave/replica/" 2020-06-11 01:01:49 +00:00
DannyS712 e4032e8e51 Remove use of the Revision object returned in WikiPage::doEditContent
Bug: T254952
Change-Id: I5ff763c0875fb1a7178deaa1c530a9fc1179c60c
2020-06-09 23:41:22 +00:00
Reedy aa702c1471 s/slave/replica/
Bug: T254646
Change-Id: I4de3985fd8568ce07919623efe2981bc0b6c54e5
2020-06-09 02:09:44 +01:00
Umherirrender 2fe223e45c Pass function name to database functions
Useful for logging

Change-Id: I95d466224ff984653051990b540f29e243915e3f
2020-06-07 03:35:53 +02:00
Umherirrender b19d4fd63b Parse messages in string context
Change-Id: I456558cb50bfe2398e24a7e9e65e939a0f936b77
2020-06-02 21:08:02 +00:00
jenkins-bot a78dd3aeaa Merge "Remove rollback from generateSampleNotifications" 2020-06-02 11:22:44 +00:00
Gergő Tisza dd1aed2930
Replace hard-deprecated WikiPage::getRevision call in generateSampleNotifications.php
...but keep soft-deprecated WikiPage::doEditContent because no realistic
replacement exists :/

Change-Id: Iee8c2fcfcbd5cb8c15854b1ada9eb691a2197658
2020-05-27 15:44:59 +02:00
DannyS712 3cb82c8813 Remove rollback from generateSampleNotifications
So that the core methods can have breaking changes

Bug: T251965
Change-Id: I6b96dfe303000e21d47b7968ab191b4536d90475
2020-05-06 00:52:25 +00:00
DannyS712 aa681141af Remove use of Article:: and WikiPage::getRevision()
Remove use of Revision objects from
GenerateSampleNotifications::generateReverted

Bug: T250532
Change-Id: I887c2d0b5599ba3acb7657b1a7636d5474f334dc
2020-04-18 01:57:36 +00:00
Umherirrender bca8d5c6ef Improve param docs
Change-Id: I664c107f324155b808e55cd6ff586fa38e0f5a0c
2020-02-29 22:20:56 +01:00
libraryupgrader ff43e1ecf2 build: Updating mediawiki/mediawiki-codesniffer to 29.0.0
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
2020-01-14 05:09:44 +00:00
libraryupgrader ef3d2b886d build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Change-Id: I03333636654eff80d4fe7fa543ac9e6c321af891
2019-12-29 11:59:32 +00:00
jenkins-bot c8eea3eb35 Merge "Add strict "array" type hints to code expecting arrays" 2019-10-28 08:48:51 +00:00
Thiemo Kreuz 0efef4faf3 Add strict "array" type hints to code expecting arrays
I found candidates for this by looking for parameters names that end
with a plural "s".

Change-Id: I61c706eb4dfbdadceb0129afd724e6ce1eb4f4a8
2019-10-24 15:18:58 +00:00
Thiemo Kreuz d79dd00e01 Use READ_LATEST constant and fix a soft type hint
Change-Id: I2123c5efe01a5b42daeec9c7b0eefce089864657
2019-10-23 12:45:51 +02:00
libraryupgrader 4bf8a6736a build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 24.0.0 → 26.0.0

npm:
* set-value: 2.0.0 → 2.0.1
  * https://npmjs.com/advisories/1012
  * CVE-2019-10747
* union-value: 1.0.0 → 1.0.1
  * https://npmjs.com/advisories/1012
  * CVE-2019-10747
* mixin-deep: 1.3.1 → 1.3.2
  * https://npmjs.com/advisories/1013
  * CVE-2019-10746

Change-Id: I6d3efdf65c207b98447565e2df6f0698aaa8ea6b
2019-07-14 10:57:49 +00:00
Derick Alangi f402ecd31f Echo: Fix case mismatch for function/method calls
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
2019-06-11 22:46:24 +01:00
Paladox e446f8aad0 Fix removeInvalidNotification script
Change-Id: I16c26e259841ff2c69b24afa3427bf74f6d17fb2
2019-05-14 16:49:05 +00:00
Derick Alangi 8e5aa13a73 Remove usage of deprecated Revision class in Echo
Class Revision is deprecated and in this patch, replaces
usage with appropriate classes; RevisionRecord, RevisionStore,
etc.

Bug: T221163
Change-Id: Icfc85167a636bef95daab236ab80113c1a3cf41b
2019-05-08 19:50:58 +01:00
Derick Alangi c4890ca86f Remove usage of deprecated database access code from Echo
Bug: T221164
Change-Id: Ib7cfe384f4104dbaeed5ba6659e81555eb810f97
2019-05-07 20:46:07 +00:00
Roan Kattouw 325708e536 removeOrphanedEvents.php: Also remove echo_target_page rows
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
2019-04-22 16:01:02 -07:00
jenkins-bot 1454df1ebe Merge "Add maintenance script to recompute notification counts" 2019-04-17 00:24:41 +00:00
Roan Kattouw 754ec9ef11 Add maintenance script to recompute notification counts
Generally applicable, but intended for users affected by the
login-success phantom notifications bug.

Bug: T220762
Change-Id: Ica428bfc19e0555564ca04d80ac5009197401aaf
2019-04-12 17:48:01 -07:00
Roan Kattouw df068ba075 removeOrphanedEvents.php: Don't remove events waiting to be emailed
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
2019-04-12 15:33:57 -07:00
Daimona Eaytoy e21e3b4a8d Add phan
Change-Id: I65ae6adc10941c05a2646e551b1baa829e4e8654
2019-04-10 18:51:59 +02:00
jenkins-bot ae11ff1e45 Merge "Fix generateSampleNotifications.php" 2019-04-05 10:59:48 +00:00
Matěj Suchánek 0d892bfae1 Fix generateSampleNotifications.php
- Wikibase is not loaded via ExtensionRegistry, yet.
- Add missing extra parameter 'entity'.

Change-Id: I6e7c989fb366b75b838327a9326856459c64987e
2019-04-05 11:07:38 +02:00
Max Semenik f055f30f86 Use addDescription() instead of accessing guts directly
Change-Id: I767cbb9969c90b645e6a94ee49b2fe2352001fd8
2019-03-26 22:07:48 -07:00
Jayprakash12345 84254318a6 Use getText() instead of getNativeData()
Bug: T155582
Change-Id: I026e0a2b309f24b6b82ec51514b26bcdbe73d957
2019-03-22 20:37:04 +00:00
Roan Kattouw ae75a8118a Remove notification_bundle_base
No longer used in the new bundling system.
Also removes indexes that contain bundle_base.

Bug: T143763
Bug: T131415
Change-Id: Ibf94cdc471a11cb14995fee6a55af0d227b50aa5
2019-03-04 13:22:17 -08:00
Roan Kattouw b73522549d Migrate and remove event_page_namespace and event_page_title
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
2019-03-04 13:12:52 -08:00
Umherirrender 833731c572 Remove non-functional maintenance script testDiscussionParser.php
It is calling an undeclared function, I have not found it in older
version of that class.

Change-Id: Ia9a432e1b90c76e8f1295c0afe4d12817bc232ae
2019-03-03 16:46:17 +01:00
Umherirrender 42f153caf5 Use ::class for class name resolution
Available since php5.5

Change-Id: I8ea594e59784bfe68911fb0b138f359a0e6b4d54
2019-03-03 15:14:15 +01:00
Thiemo Kreuz 8fd66d4281 Make use of the …::class feature in production code
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
2019-02-20 19:13:54 +00:00
Thiemo Kreuz e649551e5e Simplify a few overly complex code snippets
* 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
2019-02-19 20:39:26 +00:00
Thiemo Kreuz 8d7fc8c66a Avoid expensive array_shift where possible
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
2018-12-17 11:46:02 +01:00
Stephane Bisson 1d299ed58b Sample notifications: improve existence check and logging
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
2018-11-02 11:14:21 -04:00
Roan Kattouw de536d09d9 Make notifyAgent a per-type property rather than per-event
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
2018-10-29 15:41:51 -07:00