Commit graph

515 commits

Author SHA1 Message Date
jenkins-bot
7ea47eeb18 Merge "Add ILocalizedException interface" 2016-12-16 07:15:18 +00:00
jenkins-bot
37c0e98410 Merge "Add LoadBalancer::getMaintenanceConnectionRef() method" 2016-12-16 03:22:45 +00:00
jenkins-bot
9101cc6ef9 Merge "registration: Generalize CoreVersionChecker to VersionChecker" 2016-12-16 00:58:37 +00:00
jenkins-bot
ce079cf6ad Merge "Add CollationFa" 2016-12-15 13:37:56 +00:00
Amir Sarabadani
708c02281e Add CollationFa
Bug: T139110
Change-Id: Ie15a2ee1c22ff4a1d2b721ed137227fe83dd12ea
2016-12-15 13:25:56 +00:00
jenkins-bot
02abae3248 Merge "Add maintenance/view.php for viewing page contents" 2016-12-15 06:54:13 +00:00
Florian Schmidt
5f11f7818c registration: Generalize CoreVersionChecker to VersionChecker
This allows us to put other requirements more easily into extension
registration, such as skins and/or extensions.

Bug: T117277
Change-Id: I3ec1b28b6af380621585cd61b38e5ebb8be9f9c7
2016-12-14 19:18:09 +01:00
Aaron Schulz
fe59c39da9 Add LoadBalancer::getMaintenanceConnectionRef() method
This is useful when IMaintainableDatabase methods are needed
for foreign wiki connections to things like external store.

Also:
* Set visibility for ExternalStoreDB methods.
* Cleaned up various type hints and comments.

Change-Id: Ie35b1ff21032cc4e78912dc499486da23aeba041
2016-12-10 15:35:09 -08:00
Brad Jorsch
a90bbf1a48 Add ILocalizedException interface
We already throw around some exceptions that are localized
(ErrorPageError and its subclasses, MalformedTitleException), but
there's no standard way to recognize them. Let's change that.

Then let's use them in the API to be able to have internationalized
errors when such exceptions are caught, instead of wrapping the
English-language version.

Change-Id: Iac7c90f92a889f8de9dae373547c07b884addaea
2016-12-08 13:53:24 -05:00
jenkins-bot
3280e72c80 Merge "API: i18n for warnings and errors" 2016-12-06 19:57:45 +00:00
jenkins-bot
0e80bbf07d Merge "registration: Refactor validation logic to avoid duplication" 2016-12-06 19:06:57 +00:00
Brad Jorsch
4e6810e4a2 API: i18n for warnings and errors
API warnings and error messages are currently hard-coded English
strings. This patch changes that.

With a few exceptions, this patch should be compatible with non-updated
extensions:
* The change to ApiBase::$messageMap will blow up anything trying to
  mess with it.
* The changes to the 'ApiCheckCanExecute' hook will cause a wrong
  (probably unparsed) error message to be emitted for extensions not
  already using an ApiMessage. Unless they're currently broken like
  Wikibase.

Bug: T37074
Bug: T47843
Depends-On: Ia2b66b57cd4eaddc30b3ffdd7b97d6ca3e02d898
Depends-On: I2e1bb975bb0045476c03ebe6cdec00259bae22ec
Depends-On: I53987bf87c48f6c00deec17a8e957d24fcc3eaa6
Depends-On: Ibf93a459eb62d30f7c70d20e91ec9faeb80d10ed
Depends-On: I3cf889811f44a15935e454dd42f081164d4a098c
Depends-On: Ieae527de86735ddcba34724730e8730fb277b99b
Depends-On: I535344c29d51521147c2a26c341dae38cec3e931
Change-Id: Iae0e2ce3bd42dd4776a9779664086119ac188412
2016-12-06 10:20:48 -05:00
rlot
f27203ebfb Removed deprecated class RevisiondeleteAction
RevisiondeleteAction was deprecated in release 1.25

Bug: T61113
Change-Id: I9238d0558b21fccde70e7e23a169e114362f793e
2016-12-04 16:46:49 +00:00
Ed Sanders
5ee5ae6f69 Move link-underline user preference rule to body class
ResourceLoaderUserCSSPrefsModule is now empty and can be removed.

Change-Id: I806e117131765b859e990c14735bb9494db9a37e
2016-12-02 11:25:03 -08:00
Kunal Mehta
da68c0ae82 registration: Refactor validation logic to avoid duplication
Previously, logic to validate extension.json files was in two places:
validateRegistrationFile.php maintenance script, and the
ExtensionJsonValidationTest.php structure test. This caused duplication
as validation became more complex (e.g. usage of spdx-licenses library).

A generic ExtensionJsonValidator class now handles most of the
validation work, while the maintenance script and test case just wrap
around it for their output formats.

Change-Id: I47062a4ae19c58ee1b1f2bb4877913259bf19c8b
2016-11-30 23:04:27 -08:00
jenkins-bot
add4dcc1c0 Merge "Add DB ConnectionManagers" 2016-11-30 18:43:21 +00:00
addshore
c3c3cf9696 Add DB ConnectionManagers
This moves and refactors the ConsistentReadConnectionManager
from Wikibase into the core rdbms lib.
The refactoring also creates a generic ConnectionManager.

This relates to Iff20a22f9f2bc7ceefd6defc0ed9a494a6fe62c0
which introduced a DB factory / connection manager in
an extension revealing the need for this in multiple places.

Change-Id: I0c58e15aed5bed88323d18cb95e5008f8d3381c5
2016-11-30 11:43:22 +00:00
Gergő Tisza
98f143e0f4 Rewrite logstash key conflict warning from I6677dbf6
* do not warn if something is overwritten with an identical value
  (happens a lot with 'ip')
* move to LogstashFormatter so we can check for the value
* instead of spamming errors, just add a flag to the logstash data

Bug: T145133
Change-Id: I31caee865cd60c785126478ac75c9aefce78eaaf
2016-11-29 11:14:08 +00:00
Bartosz Dziewoński
8c20e1ae7d Add maintenance/view.php for viewing page contents
Use case:
  php maintenance/view.php Foo_bar | \
  sed s/foo/bar/ | \
  php maintenance/edit.php Foo_bar

Adapted from maintenance/edit.php and RawAction.php.

Change-Id: I170ac989e0a5b21a22054b549d62023014cb658a
2016-11-23 12:32:02 +00:00
jenkins-bot
7c99abd61d Merge "Rebuilt PHPVersionCheck to be an own class" 2016-11-07 23:20:14 +00:00
Florian Schmidt
f468fb867d Rebuilt PHPVersionCheck to be an own class
The class keyword should work in all reasonable working php installations,
as far as I know. In this way, the php version check does not rely on a
set of global functions. It also should make maintaining the different
checks a bit easier.

Change-Id: I73ee098a8cf931ca4df6263c6e0a3e215555b612
2016-11-03 17:11:36 +01:00
Brad Jorsch
715cbe468b Add hooks for WatchedItemQueryService / ApiQueryWatchlist
In order for an extension to add data to ApiQueryWatchlist, we need to
provide a way to allow it to manipulate the database query made by
WatchedItemQueryService. We also need some hooks in ApiQueryWatchlist to
handle the marshalling of data to and from WatchedItemQueryService.

To better handle hooking, this also moves some of the continuation logic
from ApiQueryWatchlist to WatchedItemQueryService.

Bug: T147939
Change-Id: Ie45376980f92da964a579887b28175c00fd8f57e
2016-11-03 11:41:40 +00:00
jenkins-bot
0e0d2bc6d7 Merge "Add PHP DateInputWidget" 2016-11-02 10:09:51 +00:00
Geoffrey Mon
fbc80326a6 Add PHP DateInputWidget
Bug: T120733
Change-Id: I8f80e27304a916bba16ed255c8e78073f9da3813
2016-11-01 17:37:52 -04:00
jenkins-bot
53779578b4 Merge "Introduce InterwikiLookupAdapter on top of SiteLookup" 2016-10-28 13:25:18 +00:00
This, that and the other
07782d176b New HTMLForm size filter field; add size filter to Special:Newpages
The conversion of SpecialNewpages to HTMLForm seems to be half-finished.
It's not using HTMLForm to read in the request query, which means we have
to roll our own logic. Kind of defeats the purpose of using HTMLForm in
the first place.

When ProtectedPages is converted to HTMLForm (T117722), it can use this new
field type.

Bug: T12817
Change-Id: I069609fbb37b18c3df25156779ad7ac7cd5d6813
2016-10-27 12:23:18 +11:00
Aaron Schulz
f13f42d149 Move FSFile classes to /fsfile
Change-Id: I21f3a9ac52b1f953ca09da0705cac868785193e1
2016-10-18 16:09:31 -07:00
Amir Sarabadani
56195efaa1 Introduce InterwikiLookupAdapter on top of SiteLookup
This adapter assumes the db name (Interwiki wiki id) equals global ids.

Bug: T135146
Change-Id: I387dc2ff3f5564fcedde835dec66781d8e9424fd
2016-10-18 10:18:31 +00:00
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