Commit graph

987 commits

Author SHA1 Message Date
David Causse
92c20832f1 Deprecate SearchResult::termMatches()
And start indicating that hooks relying on this data might become
unreliable as this data is only populated by SearchDatabase search
engines.

This information was only populated by SearchDatabase implementations
and due to bad initial design of SearchResult[Set] (now fixed) it forced
users of these classes to carry this information for the sole purpose of
highlighting.
Because SearchEngine can now own their SearchResult[Set] implementations
nothing that is engine specific should be exposed outside of these
specific implementations.
If there are some logic that still requires access to such list of terms
they should be made engine specific by guarding their code against
instanceof SqlSearchResult.

Change-Id: I38b82c5e4c35309ee447edc3ded60ca6a18b247a
Depends-On: I53fe37c65c7940f696c1e184125e01e592a976e4
2019-06-27 08:44:06 -07:00
jenkins-bot
6b9b8b9add Merge "Add Special:Mute as a shortcut for muting notifications" 2019-06-25 17:15:39 +00:00
Dayllan Maza
ed13d3fa56 Add Special:Mute as a shortcut for muting notifications
- Special:Mute has been added as a quick way for users to block unwanted
   emails from other users originating from Special:EmailUser
 - Special:Mute can be enabled by setting $wgEnableSpecialMute = true.
   This flag default value is `false`. This flag is temporary until
   enough wikis have this feature enabled and then it will go away
 - When Special:Mute is enabled, emails sent from Special:EmailUser
   contain a link to Special:Mute to facilitate access to the page

In the future, Special:Mute will support extensions to append other types
of notifications that could be muted. These are some of the tasks tracking
the rest of the work:
- T218270
- T220163
- T218266

It is worth mentioning that blocking emails from users is already available
via Special:Preferences

Bug: T218265
Change-Id: I54b847192f42ee1f37999d36c3a187f8826f55a8
2019-06-24 23:10:02 -04:00
jenkins-bot
7462d3075a Merge "language: Move some language-related classes to includes/language/" 2019-06-19 02:14:15 +00:00
jenkins-bot
efe7286cac Merge "resourceloader: Skip modules with circular deps in tree optimiser" 2019-06-18 22:59:07 +00:00
Timo Tijhof
f557b2be4f language: Move some language-related classes to includes/language/
Bug: T225756
Change-Id: Ica351483d83a3a912d58ebb194b30828541fbcf3
2019-06-18 21:38:44 +00:00
Kunal Mehta
dd8aab7382 Remove unused/deprecated Replacer classes
Change-Id: Ifec6c624810b2354f2fab2c1fd4a27267b625c4b
2019-06-17 15:46:08 -04:00
Timo Tijhof
14547fd9dc resourceloader: Skip modules with circular deps in tree optimiser
Either the server needs to omit these from the registry with
state=error output to the client (and server-side error logging),
or it needs to detect them, and transport them unchanged, so that
the existing client-side logic can handle it.

This patch does the latter.

Without the source code change in this patch, the added test case
fails due to "top" and "middle1" then being registered with
an empty array as dependencies.

Bug: T223402
Change-Id: I57502d7c4e434de4737759aed325dd4200ca89bf
2019-06-13 20:11:44 +00:00
jenkins-bot
699920cc66 Merge "objectcache: add object segmentation support to BagOStuff" 2019-06-13 18:19:17 +00:00
Bartosz Dziewoński
a8dae2212c Allow loading styles for arbitrary OOUI icon packs
You can now create ResourceLoader modules for arbitrary sets of OOUI
icons. This is an alternative to I8af783666a2b23a938af93c1b56fee619219eaf5.

Update dependencies of OOUI's modules to use custom icon packs instead
of default icon packs.

Bug: T160690
Change-Id: Icf9560da79c91e56c7a3f4c0de01dd057f5aa00d
2019-06-11 17:52:23 +00:00
Aaron Schulz
b09b3980f9 objectcache: add object segmentation support to BagOStuff
Use it for ApiStashEdit so that large PaserOutput can be stored.

Add flag to allow for value segmentation on set() in BagOStuff.
Also add a flag for immediate deletion of segments on delete().

BagOStuff now has base serialize()/unserialize() methods.

Bug: T204742
Change-Id: I0667a02612526d8ddfd91d5de48b6faa78bd1ab5
2019-06-11 16:14:17 +01:00
jenkins-bot
dfe30d5118 Merge "Refactor buildPrevNextNavigation" 2019-06-06 09:04:26 +00:00
clarakosi
4ca72763ec Refactor buildPrevNextNavigation
Refactored buildPrevNextNavigation() into standalone helper class,
PrevNextNavigationRenderer, to be used by both SpecialPages and Pagers.

Bug:T207977
Change-Id: Ic49837a451f795ec203e867961ec1c69075cc91a
2019-06-05 19:32:27 -04:00
jenkins-bot
e3705c7b17 Merge "Add action=query&meta=languageinfo API module" 2019-06-04 20:03:38 +00:00
Lucas Werkmeister
67b3cdc004 Add action=query&meta=languageinfo API module
This API module can be used to get information about all the languages
supported by this MediaWiki installation. Since parts of this
information, such as the fallback chain, are expensive to retrieve if
the localization cache is not populated, we apply continuation if the
request is taking too long (suggested by Anomie in T217239#4994301); we
don’t expect this to happen in Wikimedia production, though.

Bug: T74153
Bug: T220415
Change-Id: Ic66991cd85ed4439a47bfb1412dbe24c23bd9819
2019-06-03 12:46:03 +02:00
jenkins-bot
e5ef0fd0c6 Merge "Add checkDependencies.php" 2019-05-29 19:36:04 +00:00
Thalia
e65a5b5882 Rename Block to MediaWiki\Block\DatabaseBlock
Keep Block as a deprecated class alias for DatabaseBlock.
Update calls to the Block constructor and Block static
methods from external classes.

Also update documentation in several places that refer to
blocks as Blocks.

Bug: T222737
Change-Id: I6d96b63ca0a84bee19486471e0a16a53a79d768a
2019-05-28 12:20:48 +01:00
jenkins-bot
cc74170831 Merge "Introduce TransactionRoundAwareUpdate interface" 2019-05-25 21:37:35 +00:00
Aaron Schulz
ef949d79d2 Introduce TransactionRoundAwareUpdate interface
Refactor the deferred update transaction round handling code to use
a new TransactionRoundAwareUpdate interface. Also, rename a few
DeferredUpdates methods so they do not give the impression that
doUpdates() is always called.

Change-Id: Idc4c6d81c4e2ca0ce41bca1e7800f797fa7e37f6
2019-05-25 02:33:05 +00:00
Kunal Mehta
c20215d6f0 Add checkDependencies.php
Checks to see whether the specified MediaWiki extensions/skins have all of
their dependencies. Each thing will get a status of:

* 'loaded' (it's already activated in LocalSettings.php, and therefore all
  the dependencies are present)
* 'present' (it exists in the filesystem, but not yet activated)
* 'missing' (does not exist in the filesystem)
* 'incompatible-*' (some version requirement is incompatible)

JSON output is available with --json for use in scripts.

Development dependencies will be checked if --dev is provided.

This is roughly based on the logic already existing in the Installer. It may
be worth deduplicating that code in the future.

Bug: T193824
Change-Id: Iae9178225c10b6374484274d8848bbea6621c8c2
2019-05-24 11:56:03 -07:00
jenkins-bot
60fbf0d875 Merge "rdbms: improve query logging logic in Database" 2019-05-21 22:12:32 +00:00
Reedy
489370cf07 Remove FileRepoStatus
Change-Id: I4712d7cf8177dd3a7b8157d980dacb88a902262c
2019-05-14 16:55:59 +01:00
Ariel T. Glenn
ee66a53468 move 7zip.inc to a regular php file
Bug: T182814
Change-Id: I53746333fe3c1cdc357bf46d71a351231a845e2f
2019-05-13 11:25:24 +00:00
Ariel T. Glenn
bb880f74b1 move most of dumpTextPass to an include file so it can be subclassed
Bug: T164262
Change-Id: I9b3c54503dd9ad193af7765459613a7e73ffbb45
2019-05-13 10:14:09 +03:00
Aaron Schulz
e0cc49ce39 rdbms: improve query logging logic in Database
* Merge the two debug() calls in attemptQuery() into one single
  call which checks DBO_DEBUG. This avoids pointless SPI logger
  overhead.
* Avoid calling generalizeSQL() unless actually necessary. This
  works via a lazy-loading object.
* Make lastQuery() a bit more consistent in terms of when it
  gets updated.
* Add DBQueryDisconnectedError class for dropped connections.
* Clean up visbility and names of last query/error fields.

Change-Id: Ie8df3434d23b18f7a0f4c056d71388192cc52c6b
2019-05-08 14:58:10 -07:00
Aaron Schulz
920bb76c6d rdbms: remove unused SavepointPostgres class
Change-Id: I45117c10d7f4ab779e95536807dad055c2970117
2019-05-08 21:33:23 +00:00
jenkins-bot
27ede06954 Merge "Move ApiQueryUserInfo::getBlockInfo() to ApiBase" 2019-05-06 12:29:40 +00:00
Amir Sarabadani
693c8b2f5a Move ApiQueryUserInfo::getBlockInfo() to ApiBase
ApiBase directly uses this method causing a cyclic dependency between
ApiBase and ApiQueryUserInfo

Change-Id: I84ed21641c44b2f65ebe1980b0893d1846db3b34
2019-05-06 00:06:30 +02:00
Aaron Schulz
4d8bfbdca4 Add UserOptionsUpdateJob class
This can help avoid DB master queries on HTTP GET requests

Change-Id: I6fa2d53d96509d88f5d3e1ff18f3ca1de8fa4bb1
2019-05-03 12:02:20 -07:00
jenkins-bot
31e768e643 Merge "Make generatePhpCharToUpperMappings.php a proper maintenance script" 2019-05-02 19:34:21 +00:00
Ed Sanders
5b3106f12b Make generatePhpCharToUpperMappings.php a proper maintenance script
This allows us to use Title for converting to upper case which
will respect any compatibility fixes added later.

Bug: T219279
Change-Id: I746487df12e4628f1e37b33b7cc3cce597853596
2019-05-02 10:47:26 -07:00
Aryeh Gregor
18ec468633 Don't pass Config to service constructors
We don't want to depend on the entire site configuration when we only
need a few specific settings.

This change additionally means that these services no longer see a live
version of the settings, but rather a copy. This means in tests you
really do have to call overrideMwServices() if you want services to pick
up your config changes.

ResourceLoader and SearchEngineConfig will need more work to port,
because they expose their member Config in a getter, and the getter is
actually used.

Parser and NamespaceInfo are also relatively complicated, so I split
them into separate patches.

Tested with 100% code coverage. \o/

Depends-On: If6534b18f6657ec1aba7327463f2661037f995b3
Change-Id: I1a3f358e8659b49de4502dc8216ecb6f35f4e02a
2019-05-02 11:33:56 +03:00
Zoranzoki21
4226fada45 Split parser related files to have one class in one file
Change-Id: I36b26609ccb3f135a22961b32a46cdc06603b3e4
2019-04-27 00:41:47 +00:00
Zoranzoki21
2d4eacf50b Split ApiErrorFormatter.php to have one class in one file
Change-Id: I5c6904e32f9bc7fe3aac511c56b03757bfde15a9
2019-04-21 22:20:22 +00:00
Giuseppe Lavagetto
d46835ef4f Add ability to override mb_strtoupper in Language::ucfirst
Different PHP versions treat unicode differently, and specifically some
wiki resources become unreachable if mb_strtoupper's behavior has changed.
This patch allows to introduce an override table that allows to smooth
the transition period.

It also provides maintenance scripts to generate such an override table.

Bug: T219279
Change-Id: I0503ff4207fded4648c58c7b50e67c55422a4849
2019-04-17 15:18:44 +00:00
Aaron Schulz
950c1c3246 filebackend: move more files to subdirectories
Change-Id: If965323809c5bfc9cb73ed0f357233d9325d3353
2019-04-15 02:30:24 -07:00
Reedy
40552888fc Split DairikiDiff to class per file
Change-Id: Ica426312ec69707b9a99dfe2a7deee945c38ba35
2019-04-14 23:37:52 +01:00
jenkins-bot
6955a4afc3 Merge "Split filebackend files to class per file" 2019-04-14 22:24:56 +00:00
Reedy
79502d48e6 Rename PhpBugTests -> PhpXMLBugTester
Only contains one class (probably should be removed when we bump to PHP 7 fully)

Change-Id: Iab2bb837e2ed5d5556bd49f4236030b43aba29f1
2019-04-14 22:03:47 +00:00
Reedy
7f04a47d68 Split filebackend files to class per file
Change-Id: Idf9f4177fb9a523ce41227bda2af923bf418396b
2019-04-14 23:02:13 +01:00
jenkins-bot
63e017f4fc Merge "Split HTMLFormElement.php into class per file" 2019-04-14 21:59:45 +00:00
jenkins-bot
2ba7a9f28d Merge "Move ClassCollector to its own file" 2019-04-14 21:54:10 +00:00
jenkins-bot
81c888ab85 Merge "Move SectionProfileCallback to its own file" 2019-04-14 21:53:00 +00:00
jenkins-bot
89b0d88c38 Merge "Remove XMPReader back compat" 2019-04-14 21:25:47 +00:00
Reedy
14826d1e0c Move ClassCollector to its own file
Change-Id: I881f1ccc4aaf8babc40ad534a2a91f1ccf3baad4
2019-04-14 19:46:18 +00:00
Reedy
6341ee8fa6 Move SectionProfileCallback to its own file
Change-Id: Iccb2048eed6631caa4f20639f55866e76f9fabf0
2019-04-14 19:25:56 +00:00
jenkins-bot
492215443d Merge "Fix casing of Special Pages to match class name" 2019-04-14 19:25:29 +00:00
jenkins-bot
cea4096dd7 Merge "Remove HWLDFWordAccumulator, deprecated in 1.28" 2019-04-14 19:21:26 +00:00
jenkins-bot
535dd60c71 Merge "Remove ObjectFactory" 2019-04-14 19:21:21 +00:00
Reedy
95b8b3a4de Remove XMPReader back compat
Change-Id: I4e3ecbf6c13a7e7cfed88253eb6820e78e49e9c3
2019-04-14 19:12:54 +00:00