lhc/web/wiklou.git
4 years agoMake NameTableStore use LoadBalancer::getConnectionRef()
Aaron Schulz [Sun, 4 Aug 2019 03:38:54 +0000 (23:38 -0400)]
Make NameTableStore use LoadBalancer::getConnectionRef()

This method handles reuseConnection() calls, disallows writes to
DB_REPLICA role handles, is more consistent with wfGetDB(), and
is more efficient with I540b08920997c5.

Change-Id: I8edaef0ea4718414e2004fad04afca8ec5797669

4 years agoMerge "rdbms: make LBFactory close/rollback dangling handles like LoadBalancer"
jenkins-bot [Sat, 24 Aug 2019 23:15:36 +0000 (23:15 +0000)]
Merge "rdbms: make LBFactory close/rollback dangling handles like LoadBalancer"

4 years agoobjectcache: make WANObjectCache::relayPurge() actually use $holdoff
Aaron Schulz [Sun, 21 Jul 2019 09:53:53 +0000 (02:53 -0700)]
objectcache: make WANObjectCache::relayPurge() actually use $holdoff

Fixes a regression introduced by 70547f3fa304 in 2016.

Change-Id: I5996b63c31ac3b382e838a6858b8585bdc8c585c

4 years agoMerge "resourceloader: Map group names to integers internally"
jenkins-bot [Sat, 24 Aug 2019 22:40:59 +0000 (22:40 +0000)]
Merge "resourceloader: Map group names to integers internally"

4 years agoMerge "resourceloader: Add tests for mw.loader not storing private/user response"
jenkins-bot [Sat, 24 Aug 2019 22:40:53 +0000 (22:40 +0000)]
Merge "resourceloader: Add tests for mw.loader not storing private/user response"

4 years agoMerge "resourceloader: Add tests for disallowing access to private modules"
jenkins-bot [Sat, 24 Aug 2019 22:20:32 +0000 (22:20 +0000)]
Merge "resourceloader: Add tests for disallowing access to private modules"

4 years agoMerge "objectcache: rename getDB() to getConnection() in SqlBagOStuff"
jenkins-bot [Sat, 24 Aug 2019 20:57:17 +0000 (20:57 +0000)]
Merge "objectcache: rename getDB() to getConnection() in SqlBagOStuff"

4 years agoMerge "rdbms: make LoadBalancer::reallyOpenConnection() handle setting DBO_TRX"
jenkins-bot [Sat, 24 Aug 2019 20:55:48 +0000 (20:55 +0000)]
Merge "rdbms: make LoadBalancer::reallyOpenConnection() handle setting DBO_TRX"

4 years agoMerge "filebackend: update code comments and break some long lines"
jenkins-bot [Sat, 24 Aug 2019 20:45:44 +0000 (20:45 +0000)]
Merge "filebackend: update code comments and break some long lines"

4 years agoMerge "objectcache: improve BagOStuff arithmetic method signatures"
jenkins-bot [Sat, 24 Aug 2019 20:45:19 +0000 (20:45 +0000)]
Merge "objectcache: improve BagOStuff arithmetic method signatures"

4 years agoMerge "maintenance: Cleanup db code and bogus RevisionRecord constants in NamespaceDupes"
jenkins-bot [Sat, 24 Aug 2019 20:39:07 +0000 (20:39 +0000)]
Merge "maintenance: Cleanup db code and bogus RevisionRecord constants in NamespaceDupes"

4 years agoMerge "maintenance: Fix bogus IDatabase method calls in sqlite.php"
jenkins-bot [Sat, 24 Aug 2019 20:34:18 +0000 (20:34 +0000)]
Merge "maintenance: Fix bogus IDatabase method calls in sqlite.php"

4 years agoMerge "maintenance: Fix bad method call in RebuildTextIndex"
jenkins-bot [Sat, 24 Aug 2019 20:30:20 +0000 (20:30 +0000)]
Merge "maintenance: Fix bad method call in RebuildTextIndex"

4 years agoMerge "maintenance: Sanity check that --replicadb isn't using the master in sql.php"
jenkins-bot [Sat, 24 Aug 2019 20:30:14 +0000 (20:30 +0000)]
Merge "maintenance: Sanity check that --replicadb isn't using the master in sql.php"

4 years agoobjectcache: rename getDB() to getConnection() in SqlBagOStuff
Aaron Schulz [Fri, 9 Aug 2019 06:23:05 +0000 (23:23 -0700)]
objectcache: rename getDB() to getConnection() in SqlBagOStuff

Change-Id: I7ec33e2622f5b418712d76bedcbb4be65376cf91

4 years agordbms: make LoadBalancer::reallyOpenConnection() handle setting DBO_TRX
Aaron Schulz [Sun, 14 Jul 2019 22:43:26 +0000 (15:43 -0700)]
rdbms: make LoadBalancer::reallyOpenConnection() handle setting DBO_TRX

Make LoadBalancer::reallyOpenConnection() handle initializing DBO_TRX
instead of Database::__construct().

Also:
* Avoid having the "catch" block appear like it returns a
  half-constructed Database.
* Use the variable name $conn instead of $db to be consistent
  throughout the class. Only send Database::__construct() parameters
  that it recognizes instead of mixing in setLBInfo() data.

Change-Id: Iffc3d1d0713051a164adb51a4c4ee12e4ac887c3

4 years agomaintenance: Cleanup db code and bogus RevisionRecord constants in NamespaceDupes
Aaron Schulz [Wed, 21 Aug 2019 23:54:34 +0000 (16:54 -0700)]
maintenance: Cleanup db code and bogus RevisionRecord constants in NamespaceDupes

Change-Id: Ie31beb183d32663b368a32e4926a3ed55456719c

4 years agomaintenance: Fix bogus IDatabase method calls in sqlite.php
Aaron Schulz [Wed, 21 Aug 2019 23:41:15 +0000 (16:41 -0700)]
maintenance: Fix bogus IDatabase method calls in sqlite.php

Use getConnection() to directly get a DatabaseSqlite instance.

Change-Id: Ic349d14614b6bf145ae2e3ccdac68319fa2bbf9c

4 years agomaintenance: Fix bad method call in RebuildTextIndex
Aaron Schulz [Wed, 21 Aug 2019 23:37:48 +0000 (16:37 -0700)]
maintenance: Fix bad method call in RebuildTextIndex

This method was removed earlier this month with 2eb5bdbac6b7.

SearchSqlite already checks if the proper searchindex tables was created.
Avoid call to bogus IDatabase::checkForEnabledSearch() method.

Also make use of Maintenance::getDB()

Change-Id: If662e17093c1aef71ee9841259ca76e2ac31a7a9

4 years agoobjectcache: improve BagOStuff arithmetic method signatures
Aaron Schulz [Wed, 17 Jul 2019 19:19:05 +0000 (12:19 -0700)]
objectcache: improve BagOStuff arithmetic method signatures

Make the default $init value for incrWithInit() be $value.
This is far less suprising and also makes the operation
easier to replicate without conflicts.

Make decr() definitions more explicit since various cache
drivers do not handle negative incr() values (e.g. memcached).

Change-Id: I2b8d642656cc91c841abbd7a55d97eba101b027a

4 years agomaintenance: Sanity check that --replicadb isn't using the master in sql.php
Aaron Schulz [Thu, 22 Aug 2019 00:35:02 +0000 (17:35 -0700)]
maintenance: Sanity check that --replicadb isn't using the master in sql.php

Change-Id: I0b7fd896c88b06cbc17b31b1ae2b9cb8e375da1b

4 years agoresourceloader: Map group names to integers internally
Amir Sarabadani [Wed, 14 Aug 2019 19:39:01 +0000 (21:39 +0200)]
resourceloader: Map group names to integers internally

This makes startup response smaller.

Change-Id: Id0ae3cd7cd22163f42b92b629c38b0a806d3ca50

4 years agoresourceloader: Add tests for mw.loader not storing private/user response
Timo Tijhof [Sat, 24 Aug 2019 18:58:40 +0000 (19:58 +0100)]
resourceloader: Add tests for mw.loader not storing private/user response

This is in preparation for changing the way group indexes are transmitted
between the server and client, to confirm that the behaviour doesn't break.

Change-Id: I1f84c4c407a4eb69b5b9659d768c643d4a83df0d

4 years agoresourceloader: Add tests for disallowing access to private modules
Timo Tijhof [Sat, 24 Aug 2019 18:45:27 +0000 (19:45 +0100)]
resourceloader: Add tests for disallowing access to private modules

* Add a test to confirm that the ResourceLoader::respond() logic
  works as intended.

* Remove the client code for preventing it from being loaded.
  This can never happen in production unless there is a bug.
  Instead of optimising to avoid a pointless request that only
  happens when the software is broken, instead optimise for when
  the software is not broken by just letting it happen. The server
  already handles it just fine.

  This was originally added in 2015 with 1dd73903726 to reduce
  logspam, but that was instead fixed in 6d6b037e122 by making the
  log message debug-only (because it's not a software problem,
  it's a client-error, e.g. a broken user script or a third
  party trying out different things on the load.php entry point).

  Removing this makes the client a bit smaller, too :)

Change-Id: Ic5420d9329a73514f4fc27baa46ae58d94addafb

4 years agofilebackend: update code comments and break some long lines
Aaron Schulz [Fri, 23 Aug 2019 15:45:54 +0000 (08:45 -0700)]
filebackend: update code comments and break some long lines

Change-Id: I072e15c7c51490888284561260958e405fb061ca

4 years agoMerge "API: Warn about POST without Content-Type"
jenkins-bot [Sat, 24 Aug 2019 08:00:11 +0000 (08:00 +0000)]
Merge "API: Warn about POST without Content-Type"

4 years agoMerge "filebackend: Remove private handleWarning in favour of local closure"
jenkins-bot [Sat, 24 Aug 2019 04:38:09 +0000 (04:38 +0000)]
Merge "filebackend: Remove private handleWarning in favour of local closure"

4 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Sat, 24 Aug 2019 02:14:05 +0000 (02:14 +0000)]
Merge "Localisation updates from https://translatewiki.net."

4 years agoMerge "Skin: Add new hook, UndeletePageToolLinks, for Special:Undelete views"
jenkins-bot [Sat, 24 Aug 2019 02:03:13 +0000 (02:03 +0000)]
Merge "Skin: Add new hook, UndeletePageToolLinks, for Special:Undelete views"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 23 Aug 2019 07:07:55 +0000 (09:07 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ifdfe6ec25954eb7c61a85b6494bc0d2a18bae9a7

4 years agoMerge "rdbms: various field name and style cleanups to Database"
jenkins-bot [Fri, 23 Aug 2019 23:18:16 +0000 (23:18 +0000)]
Merge "rdbms: various field name and style cleanups to Database"

4 years agoMerge "Short-circuit WebRequest::getGPCVal() for printable ASCII strings"
jenkins-bot [Fri, 23 Aug 2019 22:31:36 +0000 (22:31 +0000)]
Merge "Short-circuit WebRequest::getGPCVal() for printable ASCII strings"

4 years agoSkin: Add new hook, UndeletePageToolLinks, for Special:Undelete views
Huji Lee [Thu, 22 Aug 2019 23:18:38 +0000 (19:18 -0400)]
Skin: Add new hook, UndeletePageToolLinks, for Special:Undelete views

This allows extensions to add further links; the particular use case
in mind is for the AbuseFilter extension, but others may want this
too.

Bug: T231055
Change-Id: I671a0479e877e6c37606b688064cb9c893717709

4 years agofilebackend: Remove private handleWarning in favour of local closure
Timo Tijhof [Fri, 23 Aug 2019 13:15:33 +0000 (14:15 +0100)]
filebackend: Remove private handleWarning in favour of local closure

This is a pattern from before PHP 5.3, which we no longer need.

Change-Id: I886d1ded25ffe1ee12b6a3f8d48c04aa7dd2ef51

4 years agordbms: various field name and style cleanups to Database
Aaron Schulz [Thu, 22 Aug 2019 00:45:43 +0000 (17:45 -0700)]
rdbms: various field name and style cleanups to Database

Rename Database::hasFlags() to sound less similar to getFlag()/setFlag().
The order of class fields is roughly:
* Objects and resources
* Configuration
* Mutable options that do not have to be kept in sync with the connection
* Session level state tracking (should be in sync with the connection)
* Transaction level state tracking (should be in sync with the connection)
* Results from or timestamp of the last time a certain event occurred

Change-Id: Ibdca2fefe7ed2c792344c5602b5191a950eed933

4 years agoMerge "objectcache: move lag waiting to SqlBagOStuff::doCas() instead of overriding...
jenkins-bot [Fri, 23 Aug 2019 19:19:51 +0000 (19:19 +0000)]
Merge "objectcache: move lag waiting to SqlBagOStuff::doCas() instead of overriding merge()"

4 years agoMerge "objectcache: add BagOStuff::fieldHasFlags() convenience method"
jenkins-bot [Fri, 23 Aug 2019 19:14:59 +0000 (19:14 +0000)]
Merge "objectcache: add BagOStuff::fieldHasFlags() convenience method"

4 years agoMerge "rdbms: remove reference to READ_LATEST in ChronologyProtector::shutdown()"
jenkins-bot [Fri, 23 Aug 2019 18:42:07 +0000 (18:42 +0000)]
Merge "rdbms: remove reference to READ_LATEST in ChronologyProtector::shutdown()"

4 years agoMerge "filebackend: use AtEase in FileBackend related classes"
jenkins-bot [Fri, 23 Aug 2019 18:41:26 +0000 (18:41 +0000)]
Merge "filebackend: use AtEase in FileBackend related classes"

4 years agoMerge "Deprecate skin functions that are not skin responsibilities"
jenkins-bot [Fri, 23 Aug 2019 18:40:25 +0000 (18:40 +0000)]
Merge "Deprecate skin functions that are not skin responsibilities"

4 years agoMerge "objectcache: make more SqlBagOStuff methods private and rename shard variables"
jenkins-bot [Fri, 23 Aug 2019 18:10:24 +0000 (18:10 +0000)]
Merge "objectcache: make more SqlBagOStuff methods private and rename shard variables"

4 years agoShort-circuit WebRequest::getGPCVal() for printable ASCII strings
Aaron Schulz [Wed, 31 Jul 2019 22:48:45 +0000 (18:48 -0400)]
Short-circuit WebRequest::getGPCVal() for printable ASCII strings

This avoids accessing the content Language instance in many cases

Change-Id: I82bd66496180f947c1af16c2728a1548df03dcf9

4 years agoMerge "objectcache: move MemcachedClient class to /utils subdir"
jenkins-bot [Fri, 23 Aug 2019 14:19:58 +0000 (14:19 +0000)]
Merge "objectcache: move MemcachedClient class to /utils subdir"

4 years agofilebackend: use AtEase in FileBackend related classes
Aaron Schulz [Tue, 20 Aug 2019 14:09:16 +0000 (10:09 -0400)]
filebackend: use AtEase in FileBackend related classes

Change-Id: I819e0e923dfd3ffa7299acd1d6103e3cdf2baa93

4 years agoDeprecate skin functions that are not skin responsibilities
Piotr Miazga [Wed, 21 Aug 2019 12:10:09 +0000 (14:10 +0200)]
Deprecate skin functions that are not skin responsibilities

Skin shouldn't be responsible for providing requested revisionId
nor if that revision is the current revision.
The OutputPage object has all required information (both the
currentRevisionID and the current Title object).

Change-Id: I2dbae4c6968a2b3b3cea3e09977e9579609b4cc5

4 years agoMerge "Move getRestrictionLevels from NamespaceInfo to PermissionManager."
jenkins-bot [Fri, 23 Aug 2019 11:27:45 +0000 (11:27 +0000)]
Merge "Move getRestrictionLevels from NamespaceInfo to PermissionManager."

4 years agoMerge "Split some Language methods to LanguageNameUtils"
jenkins-bot [Fri, 23 Aug 2019 11:16:28 +0000 (11:16 +0000)]
Merge "Split some Language methods to LanguageNameUtils"

4 years agoMerge "Allow justifications in `Special:EditTags` to use full comment length"
jenkins-bot [Fri, 23 Aug 2019 10:49:02 +0000 (10:49 +0000)]
Merge "Allow justifications in `Special:EditTags` to use full comment length"

4 years agoSplit some Language methods to LanguageNameUtils
Aryeh Gregor [Thu, 2 May 2019 14:23:42 +0000 (17:23 +0300)]
Split some Language methods to LanguageNameUtils

These are static methods that have to do with processing language names
and codes. I didn't include fallback behavior, because that would mean a
circular dependency with LocalisationCache.

In the new class, I renamed AS_AUTONYMS to AUTONYMS, and added a class
constant DEFINED for 'mw' to match the existing SUPPORTED and ALL. I
also renamed fetchLanguageName(s) to getLanguageName(s).

There is 100% test coverage for the code in the new class.

Change-Id: I245ae94bfc1f62b6af75ea57525139adf2539fe6

4 years agoAdd ObjectFactory as a service
Brad Jorsch [Wed, 21 Aug 2019 16:10:30 +0000 (12:10 -0400)]
Add ObjectFactory as a service

ObjectFactory exists to handle lazy instantiation of objects based on
declarative specifications.

One drawback to the current use of static ObjectFactory::getObjectFromSpec()
is that it doesn't have a good way to handle dependency injection. The
best you could do is refer to a static 'factory' function in your
specification, and that function would access the global service
container. But DI would prefer not to have that "global service
container" being accessed.

The solution is to have a non-static ObjectFactory that can supply
the needed services based on the object definition. For example,

 [
     'class' => MyObject::class,
     'services' => [ 'FooFactory', 'BarFactory' ],
 ]

would get the FooFactory and BarFactory from a service container to pass
into MyObject's constructor.

But in order for that to be possible, you need to have an instance of
ObjectFactory that has reference to the service container from which to
fetch the services. And the most DI-correct way to get that is to have
it dependency-injected into your constructor, at which point the
ObjectFactory instance should itself be a service in the DI service
container.

Bug: T222409
Change-Id: I2a56059a9209abce0b22fb93c9f9c6a09a825c56

4 years agordbms: remove reference to READ_LATEST in ChronologyProtector::shutdown()
Aaron Schulz [Fri, 23 Aug 2019 00:58:47 +0000 (17:58 -0700)]
rdbms: remove reference to READ_LATEST in ChronologyProtector::shutdown()

Change-Id: I34b2fa940475d5e5e81130221f61d782818a6d17

4 years agoobjectcache: make more SqlBagOStuff methods private and rename shard variables
Aaron Schulz [Fri, 9 Aug 2019 06:09:45 +0000 (23:09 -0700)]
objectcache: make more SqlBagOStuff methods private and rename shard variables

Also optimize silenceTransactionProfiler() when LoadBalancer is not in use

Change-Id: I83fd5c17058ba082a13e957e4b4590e2d1d5b581

4 years agoPermissionManager::userHas{All,Any}Right: don't specify a variadic param.
Petr Pchelko [Thu, 22 Aug 2019 20:38:09 +0000 (13:38 -0700)]
PermissionManager::userHas{All,Any}Right: don't specify a variadic param.

Change-Id: Ife9d01be57a4926f4a5efa99661163a391564a6e

4 years agoobjectcache: move lag waiting to SqlBagOStuff::doCas() instead of overriding merge()
Aaron Schulz [Thu, 22 Aug 2019 04:10:35 +0000 (21:10 -0700)]
objectcache: move lag waiting to SqlBagOStuff::doCas() instead of overriding merge()

Change-Id: I61b49bc7b00ffa8308d93e76f4bb94cf09ba9936

4 years agoobjectcache: add BagOStuff::fieldHasFlags() convenience method
Aaron Schulz [Thu, 22 Aug 2019 04:23:30 +0000 (21:23 -0700)]
objectcache: add BagOStuff::fieldHasFlags() convenience method

Change-Id: Id2bf4ec0dd0999f988b70a895003c4b1aaae51a2

4 years agoMove getRestrictionLevels from NamespaceInfo to PermissionManager.
Petr Pchelko [Wed, 21 Aug 2019 19:49:59 +0000 (12:49 -0700)]
Move getRestrictionLevels from NamespaceInfo to PermissionManager.

Bug: T11977
Change-Id: I051be9148c98086fdf53a66a74bf7c28699016db

4 years agoAllow justifications in `Special:EditTags` to use full comment length
DannyS712 [Thu, 22 Aug 2019 18:19:23 +0000 (18:19 +0000)]
Allow justifications in `Special:EditTags` to use full comment length

Bug: T188460
Change-Id: Ib3d5207432b741b9382db0d963a42ed4c8a59a79

4 years agoMerge "Deprecate and replace usages of User:isAllowed{All,Any}"
Ppchelko [Thu, 22 Aug 2019 17:31:50 +0000 (17:31 +0000)]
Merge "Deprecate and replace usages of User:isAllowed{All,Any}"

4 years agoMerge "Make LocalisationCache a service"
jenkins-bot [Thu, 22 Aug 2019 16:46:41 +0000 (16:46 +0000)]
Merge "Make LocalisationCache a service"

4 years agoMerge "Some integration tests for LockManagerGroup"
jenkins-bot [Thu, 22 Aug 2019 16:36:47 +0000 (16:36 +0000)]
Merge "Some integration tests for LockManagerGroup"

4 years agoMerge "Update .mailmap for Aryeh Gregor"
jenkins-bot [Thu, 22 Aug 2019 16:31:33 +0000 (16:31 +0000)]
Merge "Update .mailmap for Aryeh Gregor"

4 years agoSome integration tests for LockManagerGroup
Aryeh Gregor [Thu, 22 Aug 2019 11:13:44 +0000 (14:13 +0300)]
Some integration tests for LockManagerGroup

Change-Id: Ide94a260e5f96c4cfcf76c1ee9b8dcf486976263

4 years agoMake LocalisationCache a service
Aryeh Gregor [Wed, 1 May 2019 13:56:41 +0000 (16:56 +0300)]
Make LocalisationCache a service

This removes Language::$dataCache without deprecation, because 1) I
don't know of a way to properly simulate it in the new paradigm, and 2)
I found no direct access to the member outside of the Language and
LanguageTest classes.

Change-Id: Iaa86c48e7434f081a53f5bae8723c37c5a34f503

4 years agoMerge "Remove deprecated User groups/permission static calls."
jenkins-bot [Thu, 22 Aug 2019 10:58:05 +0000 (10:58 +0000)]
Merge "Remove deprecated User groups/permission static calls."

4 years agoUpdate .mailmap for Aryeh Gregor
Aryeh Gregor [Thu, 22 Aug 2019 10:30:35 +0000 (13:30 +0300)]
Update .mailmap for Aryeh Gregor

Whoever made the mailmap for old SVN contributions mapped my account to
the e-mail address I think I used on Bugzilla etc. at the time,
simetrical+mw@gmail.com. (I was inactive then, so I wasn't consulted.)
When I started committing under the git regime, I used ayg@aryeh.name,
so that should be the address used for my old commits as well so that
they link up with my new ones.

Change-Id: If03abd0e8fc11c20e7b37948f7d10f770cd43343

4 years agoMerge "BadFileLookup to replace wfIsBadImage"
jenkins-bot [Thu, 22 Aug 2019 08:16:51 +0000 (08:16 +0000)]
Merge "BadFileLookup to replace wfIsBadImage"

4 years agoMerge "Rewrite integration test for wfIsBadImage()"
jenkins-bot [Thu, 22 Aug 2019 08:16:45 +0000 (08:16 +0000)]
Merge "Rewrite integration test for wfIsBadImage()"

4 years agoMerge "Increase maximum length of automatic deletion summaries"
jenkins-bot [Thu, 22 Aug 2019 08:16:38 +0000 (08:16 +0000)]
Merge "Increase maximum length of automatic deletion summaries"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 22 Aug 2019 07:32:19 +0000 (09:32 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I2858a9ae9b37a430ea70dea57b9fbc56291b64ff

4 years agoRemove deprecated User groups/permission static calls.
Petr Pchelko [Thu, 22 Aug 2019 02:22:26 +0000 (19:22 -0700)]
Remove deprecated User groups/permission static calls.

Bug: T220191
Change-Id: Ifa8afa90c432723b0bba0033a46b6a499c77e6fc

4 years agoMerge "Add support for native image lazy loading"
jenkins-bot [Thu, 22 Aug 2019 01:48:49 +0000 (01:48 +0000)]
Merge "Add support for native image lazy loading"

4 years agoDeprecate and replace usages of User:isAllowed{All,Any}
Petr Pchelko [Wed, 21 Aug 2019 22:42:08 +0000 (15:42 -0700)]
Deprecate and replace usages of User:isAllowed{All,Any}

Bug: T220191
Change-Id: I197b8fadaa93e7b320fc19c10e3e09387fe09ad2

4 years agoIncrease maximum length of automatic deletion summaries
DannyS712 [Wed, 21 Aug 2019 23:13:16 +0000 (23:13 +0000)]
Increase maximum length of automatic deletion summaries

Currently, the maximum length is hardcoded to 255 characters.
Instead, the maximum length should be based on the actually enforce
comment store limit.

Bug: T230962
Change-Id: I4379057f8f49fd8e5efa620164eea2867fde1bfc

4 years agoobjectcache: move MemcachedClient class to /utils subdir
Aaron Schulz [Sat, 10 Aug 2019 01:14:32 +0000 (18:14 -0700)]
objectcache: move MemcachedClient class to /utils subdir

Change-Id: I2774d3e7a3c96ef691106b21908a42bfbbf25956

4 years agoMerge "rdbms: add some more comments to DatabaseDomain"
jenkins-bot [Wed, 21 Aug 2019 19:38:32 +0000 (19:38 +0000)]
Merge "rdbms: add some more comments to DatabaseDomain"

4 years agoMerge "rdbms: remove IDatabase::clearFlag() calls made redundant by QUERY_IGNORE_DBO_TRX"
jenkins-bot [Wed, 21 Aug 2019 19:38:26 +0000 (19:38 +0000)]
Merge "rdbms: remove IDatabase::clearFlag() calls made redundant by QUERY_IGNORE_DBO_TRX"

4 years agoMerge "parser: document what 0/null rev IDs do when given to Parser::parse"
jenkins-bot [Wed, 21 Aug 2019 19:38:20 +0000 (19:38 +0000)]
Merge "parser: document what 0/null rev IDs do when given to Parser::parse"

4 years agoMerge "deferred: make DeferredUpdates::attemptUpdate() use callback owners for $fname...
jenkins-bot [Wed, 21 Aug 2019 19:38:13 +0000 (19:38 +0000)]
Merge "deferred: make DeferredUpdates::attemptUpdate() use callback owners for $fnameTrxOwner"

4 years agordbms: add some more comments to DatabaseDomain
Aaron Schulz [Thu, 8 Aug 2019 00:29:28 +0000 (17:29 -0700)]
rdbms: add some more comments to DatabaseDomain

Change-Id: Iee407028a2f3c7eb6497a73d57c7baa093246217

4 years agordbms: remove IDatabase::clearFlag() calls made redundant by QUERY_IGNORE_DBO_TRX
Aaron Schulz [Wed, 7 Aug 2019 12:37:11 +0000 (05:37 -0700)]
rdbms: remove IDatabase::clearFlag() calls made redundant by QUERY_IGNORE_DBO_TRX

Change-Id: I493c63f94c813ad71dc2eb8eaf9119a1f11d62cb

4 years agoMerge "objectcache: Remove lock()/unlock() stubs from MemcachedClient"
jenkins-bot [Wed, 21 Aug 2019 18:58:58 +0000 (18:58 +0000)]
Merge "objectcache: Remove lock()/unlock() stubs from MemcachedClient"

4 years agoMerge "Convert PermissionManager constructor to use ServiceOptions."
jenkins-bot [Wed, 21 Aug 2019 18:14:12 +0000 (18:14 +0000)]
Merge "Convert PermissionManager constructor to use ServiceOptions."

4 years agoparser: document what 0/null rev IDs do when given to Parser::parse
Aaron Schulz [Thu, 27 Jun 2019 07:17:06 +0000 (00:17 -0700)]
parser: document what 0/null rev IDs do when given to Parser::parse

This was extremely obscure and tricky to figure out before

Change-Id: Ibdbb669431819eecd34de508735864e977d51021

4 years agoBadFileLookup to replace wfIsBadImage
Aryeh Gregor [Sun, 18 Aug 2019 18:19:05 +0000 (21:19 +0300)]
BadFileLookup to replace wfIsBadImage

I think this probably shouldn't be directly in the MediaWiki namespace,
but I don't know where is a better place to put it.

In order to avoid gratuitous use of TitleFormatter, I changed the cache
format -- the old implementation used getPrefixedDBkey() and I switched
to an ns/dbkey pair. I also changed the cache keys to use SHA1 instead
of MD5, by Daniel's request.

The previous implementation cached the parsed blacklist for one minute
without invalidation, so it could return slightly stale results, but it
didn't retrieve the bad image list message on a cache hit. The new
implementation unconditionally retrieves the bad image list message, but
uses a hash of it in the cache key and caches for one day. The new
behavior happens to be more cleanly implementable in a service.

Bug: T200882
Bug: T139216
Change-Id: I69fed1b1f3cfc1aa149e0739780e67f6de01609d

4 years agoRewrite integration test for wfIsBadImage()
Aryeh Gregor [Wed, 21 Aug 2019 08:14:57 +0000 (11:14 +0300)]
Rewrite integration test for wfIsBadImage()

In preparation for rewriting as a service. I didn't figure out how to
get file redirects to be tested.

Change-Id: Ic6669a19a13025744036f9f8adc4d1a25490fb42

4 years agoConvert PermissionManager constructor to use ServiceOptions.
Petr Pchelko [Wed, 21 Aug 2019 05:28:47 +0000 (22:28 -0700)]
Convert PermissionManager constructor to use ServiceOptions.

Change-Id: I36a3a2f338506ef14cc5d65b8bee2961a92d60da

4 years agoEnsure block hooks keep user state consistent with realistic blocks
Thalia [Wed, 24 Jul 2019 15:27:52 +0000 (16:27 +0100)]
Ensure block hooks keep user state consistent with realistic blocks

Several block-related hooks allow the user to be put into in a state
that is inconsistent with blocks that can actually be made:
* With UserIsHidden, User::mHideName can be set to true without there
  being a block
* With UserIsBlockedFrom, a user can be blocked from editing a page
  without there being a block
* With GetBlockedStatus, public block properties can be arbitrarily
  set on a user

These problems are mostly theoretical, but mean that it is impossible to
make some basic assumptions, e.g. that a user who is blocked from a page
must have a block. The hooks are not widely used, and with a few changes
we can make them more robust so such assumptions can be made.

This patch:
* Ensures UserIsBlockedFrom is only called if there is a block. This
  would be a breaking change if any extensions were using this to block
  an unblocked user; the intended use case is clearly for extensions to
  allow user talk page access to blocked users.
* Adds a new hook, GetUserBlockComplete, which passes the block for
  modification. This should be used instead GetBlockedStatus and
  UserIsHidden, which will be deprecated in the future.
* Allows the 'hideName' option to be passed into the AbstractBlock
  constructor so that suppressing system blocks can be made.

Bug: T228948
Bug: T229035
Change-Id: I6f145335abeb16775b08e8c7c751a01f113281e3

4 years agoMerge "TempFSFileFactory service"
jenkins-bot [Wed, 21 Aug 2019 16:21:01 +0000 (16:21 +0000)]
Merge "TempFSFileFactory service"

4 years agoMerge "REST: Use ob_clean to wipe display_errors output"
jenkins-bot [Wed, 21 Aug 2019 16:18:50 +0000 (16:18 +0000)]
Merge "REST: Use ob_clean to wipe display_errors output"

4 years agoTempFSFileFactory service
Aryeh Gregor [Fri, 16 Aug 2019 10:00:15 +0000 (13:00 +0300)]
TempFSFileFactory service

This replaces TempFSFile::factory(), which is now deprecated.

Change-Id: I9e65c3867e26c16687560dccc7d9f3e195a8bdd6

4 years agoMerge "RedirectSpecialArticle: Fix PHP notice about undefined index"
jenkins-bot [Wed, 21 Aug 2019 10:43:03 +0000 (10:43 +0000)]
Merge "RedirectSpecialArticle: Fix PHP notice about undefined index"

4 years agoMerge "mw.widgets.CalendarWidget: Tweak hover styling after OOUI changes"
jenkins-bot [Wed, 21 Aug 2019 10:28:50 +0000 (10:28 +0000)]
Merge "mw.widgets.CalendarWidget: Tweak hover styling after OOUI changes"

4 years agoreplace wfGetDB (discouraged for use) with Maintenance::getDB in dumps scripts
Ariel T. Glenn [Thu, 8 Aug 2019 13:11:36 +0000 (16:11 +0300)]
replace wfGetDB (discouraged for use) with Maintenance::getDB in dumps scripts

Bug: T228772
Change-Id: I0d9448b2565481f61d927b2d58f44bddbf358ed8

4 years agoAdd support for native image lazy loading
Gilles Dubuc [Wed, 21 Aug 2019 09:04:45 +0000 (11:04 +0200)]
Add support for native image lazy loading

Bug: T230897
Depends-On: I6c0b01fafe2c4498852e9c9b81151aba759dc5eb
Change-Id: I0307563b8f433dab062effe4dbfd7d4a9bbb8764

4 years agoMerge "Remove usages of deprecated User::getRights."
jenkins-bot [Wed, 21 Aug 2019 08:15:34 +0000 (08:15 +0000)]
Merge "Remove usages of deprecated User::getRights."

4 years agoMerge "Replace User::isAllowed with PermissionManager."
jenkins-bot [Wed, 21 Aug 2019 08:00:33 +0000 (08:00 +0000)]
Merge "Replace User::isAllowed with PermissionManager."

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 21 Aug 2019 07:12:43 +0000 (09:12 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I67fba817871853916304194753f95e330841167d

4 years agoMerge "Add $digitTransformTable for the Manipuri language"
jenkins-bot [Wed, 21 Aug 2019 05:59:19 +0000 (05:59 +0000)]
Merge "Add $digitTransformTable for the Manipuri language"

4 years agoMerge "Change the autonym of Manipuri to Meetei script"
jenkins-bot [Wed, 21 Aug 2019 05:59:13 +0000 (05:59 +0000)]
Merge "Change the autonym of Manipuri to Meetei script"

4 years agoRemove usages of deprecated User::getRights.
Petr Pchelko [Wed, 21 Aug 2019 02:21:13 +0000 (19:21 -0700)]
Remove usages of deprecated User::getRights.

Bug: T220191
Change-Id: Ia7472cf61765fe5fee9ae72cfa9b7060565dbe87