Commit graph

487 commits

Author SHA1 Message Date
Kunal Mehta
f73a68e15c Move most of MWCryptHKDF into libs
Dependency-inject the MediaWiki-specific parts into a CryptHKDF
instance, which MWCryptHKDF wraps around.

Change-Id: Idff18635cfd8a3d93ea2ca8d56cdbd11eb4d3b2b
2016-10-17 22:16:17 +00:00
Kunal Mehta
344cbdc645 Move utils/iterators/ into libs/
They have no dependency upon MediaWiki.

Change-Id: I58d59941cc7e1ba4fd5e265c8e30f59db66ed514
2016-10-16 17:33:23 +00:00
Kunal Mehta
cb117e3d59 Move MWGrants out of utils
Literally every function in this class depends upon MediaWiki, so it
does not make sense to be included in the utils/ directory.

Change-Id: If6c6b75dc11b49b75f649d56eaeb9c96ef54b787
2016-10-15 06:20:15 +00:00
Aaron Schulz
0d87d67d61 Move MimeMagic code to libs/mime/MimeAnalyzer.php
* The later resides in /libs with related files.
* Explose MimeAnalyzer as a service.
* Keep MimeMagic::singleton() as a b/c alias.
* MimeMagic::applyDefaultConfig() will bootstrap the service
  with all of the old config, extension hook handler, and
  detector command shell-out behavior.

Change-Id: Ie2695a52e7a3bcfda9f7fa83659a9ff31b372bc3
2016-10-15 00:05:16 +00:00
Kunal Mehta
c86a06ae3b Add 'pmid' to the default interwiki list, and update 'rfc'
As an alternative to using magic links, PMID was added to the default
interwiki list.

RFC already existed, but the URL in the default list was pointing to
rfc-editor.org, not the tools.ietf.org view like the RFC magic link or
Wikimedia interwiki map are.

Updating the default lists in maintenance/interwiki* only affects new
installations, so a post-database update maintenance script adds and
updates the two interwiki prefixes.

Bug: T147536
Change-Id: I5a2c2c9b0f989da62a4395c9516d880c7d923444
2016-10-06 15:15:29 -07:00
jenkins-bot
003e754dce Merge "Move most of MWCryptRand into libs" 2016-10-04 05:57:32 +00:00
Kunal Mehta
5bd6de67e3 Move most of MWCryptRand into libs
Dependency-inject the MW-specific parts of MWCryptRand via
MediaWikiServices into a generic CryptRand class that is in libs/.

Note that this removes the wfGetAllCallers() debug logging from
generate().

Change-Id: I9742735c266ee69fb247199d3c553cd2ad2a3987
2016-10-04 05:50:36 +00:00
jenkins-bot
2cbff048de Merge "Move MWCryptHash into libs/" 2016-10-04 04:33:06 +00:00
Kunal Mehta
9300bc2933 Move MWCryptHash into libs/
Remove the single wfDebug() call that was making this class MW specific,
someone can log the return value of MWCryptHash::hashAlgo() if they'd
like to know the specific implementation being used.

Change-Id: Ibb7ead7594edab7861631046dd8316daab613401
2016-10-01 23:19:28 -07:00
Kunal Mehta
9beb668d02 Split HttpFunctions.php into separate files
Change-Id: I30d5f77de08e42ec43baf5722f40d9205c4bde67
2016-10-01 22:46:07 -07:00
Reedy
c214c9a952 Detect/use APCu properly
In PHP 5.5 and above, userland APC caching moved to an extension

Bug: T140587
Change-Id: Ie0871776cd7e67838471a4fe95451cf4164079b7
2016-10-01 23:07:47 +01:00
Kunal Mehta
090d0267da Use wikimedia/wait-condition-loop
Since the WaitConditionLoop class was first introduced in 1.28 (current
master), no back-compat alias is added.

Bug: T146256
Depends-On: Ia84774d83da79fea1e167fe065c69549981f753b
Change-Id: Ibd4f15c87105b8caccbd1f661b74b6efa012b77f
2016-10-01 00:25:43 -07:00
Timo Tijhof
6191314e58 database: Rename LBFactoryMW to MWLBFactory
It's no longer an LBFactory subclass (since 5d4b009cf), and the MW-prefix
seems more natural for this class.

The class has only existed since for about 2 weeks (since 0e5cd18b7) and
is not used outside MediaWiki core across Wikimedia Git.

Change-Id: I34be982b5d10ad03e062033da9c40b4a01665289
2016-09-30 22:06:02 +01:00
jenkins-bot
64d341d043 Merge "Cleanup MemcLockManager and move it to /libs" 2016-09-30 15:49:20 +00:00
Aaron Schulz
a2dd3480da Cleanup MemcLockManager and move it to /libs
* Remove wf* function and ObjectCache dependencies.
* Use the base class session field.
* Lower physical lock structure TTL and move it to the base
  class as a constant.
* Resolve TODO about acquiring mixed lock types in one pass.
* Only mark servers down for 30 seconds in case of long-running
  scripts.

Change-Id: Icd4be407e599524cc620975d27e85666d2532b95
2016-09-30 06:33:32 -07:00
Aaron Schulz
bcd7bc2322 Move ChronologyProtector up a directory instead of being by itself
Change-Id: Ie4859a24fb22e5816718a7d1d9444316b1f444c4
2016-09-29 16:42:58 -07:00
Kunal Mehta
5320f0835e Use wikimedia/scoped-callback
The ScopedCallback class was moved into a separate library. This updates
all callers to use the namespaced version, and provides a
backwards-compatibility class wrapper under the old name.

Bug: T146258
Change-Id: I2dd0a66fe2f510f26bdfef6b0a975c1beb3fd93c
Depends-On: Iea0c40bdd7776372ccf72db8f088a2abaa4d3721
2016-09-29 10:41:40 +00:00
Aaron Schulz
0bdab07814 Move DatabaseBase to a class alias for type-hints
Change-Id: Ib6bbbd751358cbc2f2d2767c80721d3d8f142c0d
2016-09-29 06:09:03 +00:00
Stanislav Malyshev
2a395370fc Create fields & data for image/file data indexing
Bug: T145558
Change-Id: I23d4c8235d0e4150eefec31cea4b2cfdd32bf32a
2016-09-26 23:42:06 -07:00
jenkins-bot
793069b261 Merge "HTMLForm: Add HTMLDateTimeField" 2016-09-26 17:14:52 +00:00
Brad Jorsch
12bdc84219 HTMLForm: Add HTMLDateTimeField
And to do that, an OOUI PHP widget for
mw.widgets.datetime.DateTimeInputWidget too.

Bug: T146340
Change-Id: Iaa8b5892b6c3a1f3698cef59684cc3cdc9d483ea
2016-09-26 12:08:56 -04:00
jenkins-bot
bc05426ae2 Merge "Move RedisBagOStuff to /libs" 2016-09-24 22:17:10 +00:00
Aaron Schulz
51f00e3db8 Move SwiftFileBackend to /libs
Change-Id: Ied0be9891d70930caf415d75cb3b89043347f47e
2016-09-24 15:03:56 -07:00
Aaron Schulz
8729167f13 Move RedisBagOStuff to /libs
Change-Id: Ia49fb044aacb44e53d36c80277783cd806aca439
2016-09-23 20:13:36 -07:00
Aaron Schulz
1bf0390fbd Move FSFilebackend and MemoryFileBackend to /libs
Change-Id: Id38a2ef9e0e22537d0267b536f8a4dfd60c5b41d
2016-09-24 00:10:27 +00:00
jenkins-bot
c9cf1b2763 Merge "Move FileBackendStore and FileOp classes to /libs" 2016-09-23 22:52:46 +00:00
jenkins-bot
305499a998 Merge "Move RedisLockManager to /libs" 2016-09-23 22:09:31 +00:00
jenkins-bot
5680b24b3e Merge "Move RedisConnectionPool to /libs/redis" 2016-09-23 21:57:36 +00:00
Aaron Schulz
6e5329cd8e Move FileBackendStore and FileOp classes to /libs
Change-Id: If490f64bec282e5dfcdaf7feb1cbf46d3dce1064
2016-09-23 14:46:53 -07:00
jenkins-bot
5c529ac835 Merge "Add HTTPFileStreamer class" 2016-09-23 21:28:52 +00:00
Aaron Schulz
24aa72de84 Add HTTPFileStreamer class
* Move most StreamFile code to this new class
* Remove StreamFile depedency from FileBackendStore

Change-Id: I4a272ef49497b589114fc2b37ba800bc26d9161f
2016-09-23 14:22:04 -07:00
jenkins-bot
b9ad2beaba Merge "Move FileBackendMultiWrite to /libs" 2016-09-23 21:08:57 +00:00
jenkins-bot
1319754d66 Merge "Add IMaintainableDatabase for non-OLTP type methods" 2016-09-23 20:37:59 +00:00
Aaron Schulz
616fabe05a Move FileBackendMultiWrite to /libs
Change-Id: I8079693a62db390028cd9f72b2bd7a81ae1164c3
2016-09-23 20:19:11 +00:00
Aaron Schulz
44705ce9dd Add ILBFactory interface for completeness
Also fixed comment indentation.

Change-Id: I535d320b63477302b06fd634b3ab47eef6868ffc
2016-09-23 12:12:47 -07:00
jenkins-bot
43885ef092 Merge "Add HTMLFormField class for MWRestrictions and use it for bot passwords" 2016-09-23 15:25:11 +00:00
Aaron Schulz
49e0691b71 Move RedisLockManager to /libs
Change-Id: Ia476f117243cf0f6984e373d460b24db18584704
2016-09-23 00:30:47 -07:00
Aaron Schulz
10593ffaab Move RedisConnectionPool to /libs/redis
Change-Id: Ied4a85d7172ab76b90f6d9ce4d47a83c3fd7d111
2016-09-23 00:20:19 -07:00
Aaron Schulz
2073a25695 Move more LockManager classes to /libs
Change-Id: I4bfa79f430827b8717a57bb61cb7c36bc7fcb489
2016-09-22 22:26:18 -07:00
Aaron Schulz
3caf63e016 Add IMaintainableDatabase for non-OLTP type methods
Change-Id: I4cbdfd7a40af17269c527df6e1c3c5644672b8a7
2016-09-23 04:03:11 +00:00
Reedy
a0fa3e4dc0 Rename includes/Services to includes/services for consistency
Change-Id: I900fab26a7cf5a339233f55c31168f8c2963bc8c
2016-09-23 00:08:15 +00:00
Aaron Schulz
c2acd8f642 Simplify and clean up FileBackend exceptions
Use standard exceptions for unexpected errors and remove
FileBackendException class, leaving FileBackendError. The
later is actually intended to be caught in some cases.

Change-Id: I735a525e0b14e518b2da5f18762e0f293064dfc2
2016-09-22 15:28:08 -07:00
Gergő Tisza
3090a1d1f8 Add HTMLFormField class for MWRestrictions and use it for bot passwords
Change-Id: Ib50238e3be5eec63eb5df97154b60dc4ca33d581
2016-09-22 20:50:36 +00:00
Aaron Schulz
aa9d1c91b6 Split up DBError classes into their own files
Change-Id: I671f1a88f0192a5199cfc9c6d7fbde1bff5c4ac8
2016-09-22 13:32:08 -07:00
Kunal Mehta
8e9d2e93ca Rename Convert*a*bleTimestamp to Convert*i*bleTimestamp
Per the dictionary.

Change-Id: I3dcef9fb020c8c6764ee073111ed8c032e4c5a63
2016-09-21 21:43:32 -07:00
jenkins-bot
e8985f2338 Merge "Move IP class to libs/" 2016-09-22 03:30:06 +00:00
jenkins-bot
07d5f507ae Merge "Remove MimeMagic depedency from FSFile and move it to /libs" 2016-09-22 03:25:20 +00:00
jenkins-bot
57711e7e13 Merge "Move IP::isConfigured/TrustedProxy() to ProxyLookup service" 2016-09-22 03:19:27 +00:00
Kunal Mehta
04dfd9b6bc Move IP class to libs/
Also fix some misplaced parenthesis in IPTest.

Change-Id: I84d6120c49f733ec45e7e0005259871808b7568b
2016-09-21 20:18:08 -07:00
Aaron Schulz
724b2cf912 Remove MimeMagic depedency from FSFile and move it to /libs
Change-Id: Ieaae909b49c798b6e9bed65d15961cefbdaec49b
2016-09-22 03:17:04 +00:00