Commit graph

1084 commits

Author SHA1 Message Date
jenkins-bot
2296134f52 Merge "Add PSR-4 mappings for existing namespaces and the top level" 2020-03-12 17:44:05 +00:00
jenkins-bot
43705de4f9 Merge "Add RefreshSecondaryDataUpdate and use it in DerivedPageDataUpdater" 2020-03-12 17:43:57 +00:00
jenkins-bot
e005e08768 Merge "Add a ContentModelChange helper, and an api module that uses it" 2020-03-11 22:10:01 +00:00
Aaron Schulz
1f4efc6c34 Add RefreshSecondaryDataUpdate and use it in DerivedPageDataUpdater
This class implements EnqueueableDataUpdate and can be pushed as a
job if it fails to run via DeferredUpdates.

Unlike a1f7fd3ada, make RefreshSecondaryDataUpdate skip failing
updates in doUpdate(). Instead of throwing the first exception from
any update, log any exceptions that occur and try all the other
updates. The first error will be re-thrown afterwards.

Also, make sure that each DataUpdate still has outer transaction
scope. This property is documented at mediawiki.org and should not
be changed.

Add integration tests for RefreshSecondaryDataUpdateTest.

Bug: T218456
Bug: T206283
Change-Id: I7c6554a4d4cd76dfe7cd2967afe30b3aa1069fcb
2020-03-11 00:42:48 -07:00
Tim Starling
f81462048a Add PSR-4 mappings for existing namespaces and the top level
This reduces the size of the class map ($wgAutoloadLocalClasses),
and allows new classes and namespaces to be added without modifying
the class or namespace map as long as they conform to PSR-4.

Adding a PSR-4 mapping for the top-level MediaWiki namespace means that
conforming subnamespaces do not need to be listed.

I did not add some odd or broken cases, since I figure it's better to
fix them by moving the files, which can be done in a separate commit.

I removed testPSR4Completeness, since PSR-4 completeness is no longer
required, that's the point.

Bug: T166010
Change-Id: Ie5e50ecb519b99a1197688c046c7be245ce6da1b
2020-03-10 21:08:30 +11:00
jenkins-bot
19e1d9a08d Merge "objectcache: split out StorageAwareness/ExpirationAwareness from IExpiringStore" 2020-03-03 22:55:24 +00:00
jenkins-bot
25a0d01d19 Merge "Revert "Split FakeMaintenance and LoggedUpdateMaintenance to their own files"" 2020-03-03 14:30:58 +00:00
Daimona Eaytoy
7def03fe80 Revert "Split FakeMaintenance and LoggedUpdateMaintenance to their own files"
This reverts commit 2cdeb26d0c.

Reason for revert: broke roughly all scripts extending LoggedUpdateMaintenance.

Bug: T246754
Change-Id: Icfe3da924c364b4b4f9286871aeb0aa9f1bbff1a
2020-03-03 14:14:31 +00:00
Aaron Schulz
69950da666 objectcache: split out StorageAwareness/ExpirationAwareness from IExpiringStore
Add more detailed QOS_* constants while at it

Bug: T236412
Change-Id: Ia862c5111a3daf10a34fc78163301629228efa6b
2020-03-02 20:01:24 +00:00
Reedy
c448337b61 Add a maintenance script to block a list of users
Bug: T246368
Change-Id: I93b7d92023af06adabd7767f30b5179d12223be1
2020-03-02 19:35:03 +00:00
Reedy
2cdeb26d0c Split FakeMaintenance and LoggedUpdateMaintenance to their own files
Change-Id: I4c95f910993fffa060c2860847b8cfff1612ccf5
2020-02-28 21:51:24 +00:00
DannyS712
0789d1568d Add a ContentModelChange helper, and an api module that uses it
Bug: T107174
Change-Id: I6eb38c4aec23619d7ec42ef12092edf9ff25c6fa
2020-02-27 19:02:29 +00:00
Timo Tijhof
007a0620db resourceloader: Convert mediawiki.Uri to package files
This replaces the client-side compiler for 'mediawiki.template.regexp',
with a simple PHP callback.

The regexp temple compiler is not used anywhere after this and will be
removed in a follow-up commit.

Bug: T233676
Change-Id: I1baa1465d88293d03975cadf2efdd57283427722
2020-02-24 17:45:31 +00:00
Tim Starling
44d51cb04e Fix the namespace of SpecialPageFactory
Follows-up d4045035b0.

This class was added to the MediaWiki\Special namespace, contrary to the
plan in T166010 which reserves that namespace for core special pages.
Instead, use MediaWiki\SpecialPage, following the directory in which it
is located.

Also, fix two bugs which prevented the introduction of a namespaced
class alias.

Bug: T166010
Change-Id: I6e31340aaae32a89beb7e45b79d76a7fea9808d2
2020-02-21 13:46:19 +11:00
Aaron Schulz
6b12696452 Move UIDGenerator code to a service and put it under /libs
All MediaWiki dependencies have been removed or injected.

Change-Id: I01c9e96edd6b03496c1595670967ffa5a4069c9d
2020-02-18 00:20:40 +00:00
jenkins-bot
b21453f61d Merge "widgets: Split out SearchWidgets into their own tree" 2020-02-15 00:20:08 +00:00
Aaron Schulz
5282a02961 resourceloader: support tracking indirect module dependency paths via BagOStuff
This can be enabled via a configuration flag. Otherwise, SqlModuleDependencyStore
will be used in order to keep using the module_deps table.

Create a dependency store class, wrapping BagOStuff, that stores known module
dependencies. Inject it into ResourceLoader and inject the path lists into
ResourceLoaderModule directly and via callback.

Bug: T113916
Change-Id: I6da55e78d5554e30e5df6b4bc45d84817f5bea15
2020-02-13 17:26:36 +00:00
jenkins-bot
c3f20ad3f7 Merge "Add SelectQueryBuilder" 2020-02-13 00:04:11 +00:00
James D. Forrester
3a9a542e1d widgets: Split out SearchWidgets into their own tree
Expecting people to magically know that MediaWiki\Widget\SearchInputWidget is
generic and for use on random pages, but MediaWiki\Widget\SearchResultWidget
is super-specialised, based on bespoke technologies, and only for use on
Special:Search, is not great.

None of these are used outside the MediaWiki core codebase and so this change
whilst it would otherwise be technically breaking is fine.

Change-Id: I16d21dd5e1ac3aa9893863df272d1bbb4788066f
2020-02-11 14:37:27 -08:00
Peter Ovchyn
f136c2953c languages: More doc annotations for LanguageConverter related classes
Deprecated LinkHolderArray for public usage

Bug: T244709
Change-Id: Ic5b9e9237044b56cbb64e7c762f5d2de3b1de821
2020-02-11 17:32:12 +02:00
Tim Starling
d06a3e049b Add SelectQueryBuilder
Add a query builder class which encapsulates the parameters to
IDatabase::select() and related functions.

Override useIndexClause() and ignoreIndexClause() in DatabaseTestHelper
so that index hints can be tested.

Bug: T243051
Change-Id: I58eec4eeb23bd7fb05b8b77d0a748f1026afee52
2020-02-07 10:10:17 +11:00
ArtBaltai
30e54b3962 Introduce ContentHandlerFactory
Added:
- ContentHandlerFactory
Tests:
- PHPUnit
Changed
- Calls of changed and deprecated
- DI for some service/api
Deprecated:
- ContentHandler::* then similar to ContentHandlerFactory
- ContentHandler::getForTitle
- ContentHandler::$handlers

Bug: T235165
Change-Id: I59246938c7ad7b3e70e46c9e698708ef9bc672c6
2020-02-07 00:53:51 +03:00
Brad Jorsch
c2b1525908 API: Use ParamValidator library
This brings significant modularization to the Action API's parameter
validation, and allows the Action API and MW REST API to share
validation code.

Note there are several changes in this patch that may affect other code;
see the entries in RELEASE-NOTES-1.35 for details.

Bug: T142080
Bug: T232672
Bug: T21195
Bug: T34675
Bug: T154774
Change-Id: I1462edc1701278760fa695308007006868b249fc
Depends-On: I10011be060fe6d27c7527312ad41218786b3f40d
2020-02-04 13:36:14 -05:00
Peter Ovchyn
863a1d5bdd languages: Move Converter and tests to respective files
Bug: T226833, T243760
Change-Id: I6fc7f267098d663fbefd0e78457726c343c9b3e4
2020-02-03 15:31:08 +02:00
Peter Ovchyn
61e0908fa2 languages: Introduce LanguageConverterFactory
Done:
* Replace LanguageConverter::newConverter by LanguageConverterFactory::getLanguageConverter
* Remove LanguageConverter::newConverter from all subclasses
* Add LanguageConverterFactory integration tests which covers all languages by their code.
* Caching of LanguageConverters in factory
* Make all tests running (hope that's would be enough)
* Uncomment  the deprecated functions.
* Rename FakeConverter to TrivialLanguageConverter
* Create ILanguageConverter to have shared ancestor
* Make the LanguageConverter class abstract.
* Create table with mapping between lang code and converter instead of using name convention
* ILanguageConverter @internal
* Clean up code

Change-Id: I0e4d77de0f44e18c19956a1ffd69d30e63cf51bf
Bug: T226833, T243332
2020-02-03 11:38:03 +02:00
Aaron Schulz
758e980427 objectcache: remove APCBagOStuff class
apcu comes with PHP 5.5+ and the minimum version for MediaWiki is 7.2

Change-Id: I69a988c6c2999766a3c7e56b841cd4f4091b4d95
2020-01-29 17:27:47 +00:00
C. Scott Ananian
5cbb64f56a Remove Preprocessor_DOM, deprecated in 1.34
Remove the deprecated Preprocessor_DOM class, which was hard-deprecated
in 1.34.  This begins to simplify parser configuration and reduce redundant
code paths, but I've left two things for cleanup in a future patch:

1. The `preprocessorClass` configuration option to the parser, exposed
in `$wgParserConf`, ServiceWiring, ParserFactory, etc.  There is no reason
for this to be exposed as configurable, but I've left this clean up to a
future patch.

2. The `$wgMaxGeneratedPPNodeCount` configuration, exposed also in
ParserOptions.  Only Preprocessor_DOM calculated this count, and since
we are only using Preprocessor_Hash now, this configuration has no effect.
But since this value was exposed in ParserOptions and elsewhere, I've
deprecated where needed but left this clean up to a future patch.

Bug: T204945
Change-Id: I727f003f9a42d0c92bcbcce8a8289d5af6cd1298
2020-01-25 11:22:45 -05:00
Bill Pirkle
512b0b08d9 Add core REST API endpoint for media links
Add an endpoint to the core REST API to return the list of
media files embedded in a page, including certain metadata
for each media file.

Bug: T236169
Change-Id: I3188848ee7de365d209dfb7da5b885313e9f705b
2020-01-22 15:10:44 -06:00
Reedy
ec5b793fd0 Remove 1.33 aliases from libs/services
Change-Id: Ib120d58194662c3fa05784736eb5c82d7892777d
2020-01-09 21:37:29 +00:00
mainframe98
297a89069a Add LinkBatchFactory to inject services into LinkBatch
All services required by LinkBatch are now injected by the
LinkBatchFactory. The constructor for LinkBatch has been
soft-deprecated, but the required services are still optional.

Bug: T239855
Depends-On: If49cbb730d4ac48586b891908cf24601efbc5d6a
Change-Id: I93d931ab60305ad49a6e419f8269c77791a3938d
2020-01-06 17:02:31 +01:00
DannyS712
f6417508c2 Remove FileBasedSiteLookup class, deprecated and unused
Bug: T241356
Change-Id: I252904b6b4c31a0ac42cbfbe7875a23c727150c1
2020-01-03 23:59:16 +00:00
jenkins-bot
74aee4ed08 Merge "Use wikimedia/ip-utils 1.0.0 to replace IP class" 2020-01-01 23:55:38 +00:00
James D. Forrester
610954eda6 Use wikimedia/ip-utils 1.0.0 to replace IP class
Adjust use in ApiBase.

Depends-On: I9a172b2bd922c3a62248545906bd9bdfcac03a43
Change-Id: Ie5485b1df9f3886add943ddcf8b0824e87a7f3e4
2020-01-01 02:29:11 -08:00
TheSandDoctor
01b9bfd5ae Remove MWMessagePack
MWMessagePack has been removed.

Bug: T241220
Change-Id: I1e1823c3b42022d6b045b8d33bebb1be7da95631
2019-12-30 00:00:39 -08:00
Timo Tijhof
8373f51cb0 benchmarks: Exclude from PHPUnit test coverage
Also move Benchmarker.php to maintenance/includes/ because
that file is not itself a benchmark, and that base class is
actually covered by tests and should remain included.

Change-Id: I4acd88242dde56a884d319dfc141a3511a8221a3
2019-12-18 01:24:42 +00:00
jenkins-bot
808c737df6 Merge "Create abstract special page SpecialRedirectWithAction, and use it." 2019-12-02 17:59:36 +00:00
Tim Starling
164a3ac1f0 Remove IE 6 security features from server-side code
* Deprecate WebRequest::checkUrlExtension() and have it always return
  true. This reverts the security fixes made for T30235.
* Remove IEUrlExtension. This is a helper for checkUrlExtension() which
  is not used in any extensions.
* Remove CSS sanitization code which is specific to IE6. This reverts
  the changes made to fix T57332, and related followups. I confirmed
  that the relevant test cases do not result in XSS on IE8.
* Remove related tests.

Bug: T232563
Change-Id: I7318ea4a63210252ebc64968691d4f62d79a63e9
2019-11-28 15:11:56 +11:00
DannyS712
f3e2b140c8 Create abstract special page SpecialRedirectWithAction, and use it.
Special:Edit, Special:History, Special:Purge, and Special:Info all
redirect to index.php?title=$1&action=, where the action is edit,
history, purge, or info. Thus, they can each extend a common class.

Bug: T13456
Change-Id: I64aca28075f5d79ec841b6868e1760f2dac4ec90
2019-11-28 01:00:28 +00:00
Max Semenik
ee1af9bc72 Rewrite cdb.php to use Maintenance
Change-Id: Ia3fbfbe2e89401d867f457b89a19bebdced5dd3a
2019-11-11 20:17:40 -08:00
Amir Sarabadani
30c4b22d4e Start of DoctrineSchemaBuilder
This allows us to abstract away schemas into one json file.

Bug: T230419
Change-Id: Ic8a658c97150e4c248bdbc9a5cf5d947b8c71036
2019-11-09 21:32:32 +00:00
jenkins-bot
5e27e79c6d Merge "Add renameRestrictions.php maintenance script" 2019-11-08 15:41:58 +00:00
Max Semenik
38a9f0a42a Add a maintenance script to delete a change tag
Based on Ib8b96b8460db3832e9297a07922ee1d9d1af5ccb by Legoktm.

Bug: T75181
Change-Id: I0e61dfbc72fe27efa9c1deabc928e7c9af66e1bc
2019-11-07 16:57:51 -08:00
Martin Urbanec
25d1f724a6 Add renameRestrictions.php maintenance script
Bug: T237194
Change-Id: I64a54980c3ef00d345a180dff10d8ffa917916bd
2019-11-07 22:29:25 +01:00
Timo Tijhof
0da1ecfd89 profiler: Remove ProfilerOutputDb and profileinfo.php entry point
Bug: T231366
Change-Id: I211c8192200d9af00914f9847608a6daf2898f91
2019-11-06 15:28:00 -05:00
Max Semenik
93a27f83f9 Remove PhpXmlBugTester
This bug was fixed over 10 years ago and is impossible to encounter
on modern libxml versions. While libxml versions might vary slightly
for the same PHP version depending on how it's built, this gives a
general idea:

https://3v4l.org/Tk27c

Change-Id: I669abb3543180e6edd090297fcfcb811aa833b57
2019-10-31 00:44:40 +00:00
Ed Sanders
e20a6e516a Move deflate method to MW util and deprecate EasyDeflate module
This will allow us to easily change the deflate library in future.

Rename the PHP class and i18n to just "Deflate".

Bug: T236210
Change-Id: I88dea5e82a7f672e36556c40b151ac00ff3d044e
2019-10-30 15:03:41 +00:00
Aryeh Gregor
e787246ce8 LanguageFactory to replace Language::factory()
Languages with variants no longer can override the parent's constructor
(which is now used for injecting services). Instead, they need to
override Language::newConverter().

Bug: T201405
Change-Id: I923400d61763cf1db88cb0c3f684c9c10e58032d
2019-10-23 10:48:23 -07:00
jenkins-bot
0915ac1713 Merge "Add TitleFactory" 2019-10-21 18:02:41 +00:00
jenkins-bot
abfea4c7ff Merge "Add faux SearchResult and SearchResultSet" 2019-10-21 09:37:50 +00:00
Gergő Tisza
95586dd937
Add TitleFactory
Makes it possible to mock static Title methods in tests, where
they are one of the more common reasons for not being able to
use MediaWikiUnitTestCase.

Actually introducing dependency injection to Title is left for
the future.

Change-Id: I959ba87f8e283da9549b6bfcefd338e60b00be8f
2019-10-18 00:00:46 +02:00