Commit graph

1007 commits

Author SHA1 Message Date
Aryeh Gregor
8ec24b607a Introduce MovePageFactory
This will help make MovePage more testable.

In the course of abstracting the logic out of ParserFactoryTest to
FactoryArgTestTrait so it could be used in MovePageFactoryTest, I made
them all unit tests instead of integration. This required some
modification to the Parser constructor so that it didn't access
MediaWikiServices unnecessarily.

Change-Id: Idaa1633f32dfedfa37516bb9180cfcfbe7ca31aa
2019-08-19 20:25:31 +03:00
Amir Sarabadani
4b80ca45f7 Drop last bits of oracle
Undefined constant

Change-Id: I66f17a7647bdcf254695dd0d3a0d49d41a35fff3
2019-08-14 23:44:22 +02:00
Amir Sarabadani
4d10bb14e8 Drop Oracle and Mssql
After approval of RFC T191231, we are going to drop oracle and mssql
and it will be possible to bring back the support using the abstract schema

Adding to release notes will be done in a follow-up

Bug: T230418
Change-Id: I90bd5cfcc3e18011b193c965fdb1fa54675040b5
2019-08-14 11:31:41 +00:00
jenkins-bot
fab912b65c Merge "Create Special:NewSection special page" 2019-08-07 20:24:41 +00:00
Daniel Kinzler
aa4da3c2e8 Revert "Add small HtmlCacheUpdater service class to normalize purging code"
This reverts commit 35da1bbd7c.

Reason for revert: wrong tab, wrong patch. Ooops.

Change-Id: I5828fff6308d43460a3b2b10f60996409181f8b3
2019-08-07 13:56:30 +00:00
Aaron Schulz
35da1bbd7c Add small HtmlCacheUpdater service class to normalize purging code
The purge() method handles purging of both file cache and CDN, using
a PRESEND deferred update. This avoids code duplication and missing
file cache purge calls.

Also:
* Migrate HTMLCacheUpdate callers to just directly using HTMLCacheUpdateJob
* Add HtmlFileCacheUpdate class and defer such updates just like with CDN
* Simplify HTMLCacheUpdate constructor parameters
* Remove BacklinkCache::clear() calls which do nothing since the backlink
  query does not actually happen until the job runs

Change-Id: Ic453b189a40109a73a9426538608eea87a76befa
2019-08-06 13:45:27 -07:00
Aaron Schulz
0bee81df81 Move WANObjectCache to wancache/ instead of WinCache
Follow up 6ca3de5fa0.

Change-Id: I7021dfe5c900f810ab3b6dc701a04e2c3e1c4c66
2019-08-02 22:07:47 +00:00
Aaron Schulz
6ca3de5fa0 Move WAN cache classes under a new wancache/ directory
Change-Id: I6837761ebca7557e029e1f65beca738266e48efb
2019-08-02 14:46:23 -04:00
DannyS712
95b257375c Create Special:NewSection special page
Bug: T207577
Change-Id: If69a8e13b524f55f78b2f61aadf1f9045fda5ff2
2019-08-02 12:34:13 +00:00
jenkins-bot
d64df8329b Merge "Make CliInstaller control the processing logic of the error" 2019-08-01 00:01:08 +00:00
RazeSoldier
b873e9294b Make CliInstaller control the processing logic of the error
Previously, if there was an error during CLI installation,
CliInstaller::showStatusMessage() exited the script directly. The exit
timing of the script should be given to the caller, not the callee.
So, I coding:
[1] Remove `exit()` from CliInstaller::showStatusMessage()
[2] Make the callee to return Status, the caller determine how to handle these Status
[3] Strictly check the key database type instead of just outputting message

Bug: T46511
Change-Id: I72ffd33fe5c592b9ea78f37bae5a9c081295c624
2019-07-29 20:18:08 +08:00
David Causse
ff6b6a758a Add SearchResultSetTrait
trait meant to hold methods that rarely overridden or that are
non trivial to implement.

Bug: T228626
Change-Id: I4fba27b22860109d648e830a435d4a036d26ad06
2019-07-25 15:52:36 +02:00
David Causse
e97ff3524b Add BaseSearchResultSet
Meant to hold the B/C behaviors and be the base class implemented
by extensions.

Bug: T228626
Change-Id: I072a9bd0f94bd785d1ff51f0e6ee13790e37b417
2019-07-25 15:47:01 +02:00
David Causse
6af636fb03 Add ISearchResultSet
Bug: T228626
Change-Id: I3306bf6107c97dd58adf578fd965bd11a422627d
2019-07-22 18:27:39 +00:00
Aaron Schulz
bebe30333d objectcache: add MediumSpecificBagOStuff base class for non-proxy subclasses
This make it much clearer what needs to be overridden

Change-Id: I3073f8a0605f557c6a3a93d0d8401cddd0fb8dbe
2019-07-19 13:01:46 -07:00
jenkins-bot
04d1aa3033 Merge "maintenance: Script to rename titles for Unicode uppercasing changes" 2019-07-10 06:42:16 +00:00
Brad Jorsch
9ef8c9608d maintenance: Script to rename titles for Unicode uppercasing changes
This uses MovePage where possible to try to better keep data in sync.
Archives, log entries, and so on can't do that though.

The script skips User and User_talk pages for registered users, as
renaming the users is more complicated than makes sense to try to
implement here. Use something like Extension:Renameuser to clean those
up; this script can provide a list of user names affected.

Bug: T219279
Change-Id: I157577cb5bedfd347b808c254fb19ae8088818ab
2019-07-09 13:53:43 -04:00
Aaron Schulz
670687fae0 objectcache: add IStoreKeyEncoder interface for key generation helper methods
If a key is stored in both BagOStuff and WANObjectCache, it useful to have
one common method for generating the cache and storage keys.

Change-Id: I8b77651746a55e8a98a79db298226e334d15a494
2019-07-08 22:33:07 +00:00
Reedy
d7451a03e9 Move MultiHttpClient.php to libs/http
Change-Id: I199e615fad363b1439604c9d01a9a475856d6128
2019-07-01 21:47:57 +01:00
Aaron Schulz
baafb5adb4 Make ExternalStore wrap ExternalStoreFactory and create access class
* Inject settings and global instances as dependencies to the
  ExternalStoreMedium instances. This includes the local wiki
  domain, so that wfWikiId() calls are not scattered around.
* Create ExternalStoreAccess service for read/write logic.
* Deprecate the ExternalStore wrapper methods.
* Add some exception cases for bogus store URLs are used instead
  of just giving PHP warnings and failing later.
* Make moveToExternal.php require the type/protocol to decide
  which ExternalStoreMedium to use instead of assuming "DB".
* Convert logging calls to use LoggerInterface.

Change-Id: I40c3b5534fc8a31116c4c5eb64ee6e4903a6197a
2019-06-28 14:31:44 -07:00
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