lhc/web/wiklou.git
2 years agoMerge "resourceloader: Remove comment about XmlJsCode wrapper"
jenkins-bot [Tue, 10 Sep 2019 16:14:45 +0000 (16:14 +0000)]
Merge "resourceloader: Remove comment about XmlJsCode wrapper"

2 years agoMerge "specials: Declare dynamic properties"
jenkins-bot [Tue, 10 Sep 2019 16:06:06 +0000 (16:06 +0000)]
Merge "specials: Declare dynamic properties"

2 years agoMerge "widget: Improve properties documentation"
jenkins-bot [Tue, 10 Sep 2019 16:04:18 +0000 (16:04 +0000)]
Merge "widget: Improve properties documentation"

2 years agoMerge "Restore FileBackendStoreOpHandle::call"
jenkins-bot [Tue, 10 Sep 2019 15:45:17 +0000 (15:45 +0000)]
Merge "Restore FileBackendStoreOpHandle::call"

2 years agoMerge "Revert "Improve MultiHttpClient connection concurrency and reuse""
jenkins-bot [Tue, 10 Sep 2019 15:39:24 +0000 (15:39 +0000)]
Merge "Revert "Improve MultiHttpClient connection concurrency and reuse""

2 years agoRestore FileBackendStoreOpHandle::call
Daimona Eaytoy [Tue, 10 Sep 2019 13:18:25 +0000 (15:18 +0200)]
Restore FileBackendStoreOpHandle::call

Follows-up eb06fb858e8492453ddb66f9b813e.

The property is still in use, see
https://codesearch.wmflabs.org/core/?q=-%3Ecall%5Cb&i=nope&files=&repos=

and failures at
https://integration.wikimedia.org/ci/job/mediawiki-core-php72-phan-docker/5893/console.

Change-Id: Ic9e72c3ab57cef3dd16c64ce279875df10ba3a14

2 years agoRevert "Improve MultiHttpClient connection concurrency and reuse"
Reedy [Tue, 10 Sep 2019 14:56:38 +0000 (14:56 +0000)]
Revert "Improve MultiHttpClient connection concurrency and reuse"

This reverts commit 46531d62852239f620f7b7c0af1e5747a9006228.

Bug: T232487
Change-Id: I8b1b829197f0f5758a85cb1547e13448d425aed2

2 years agospecials: Declare dynamic properties
Daimona Eaytoy [Tue, 10 Sep 2019 12:30:41 +0000 (14:30 +0200)]
specials: Declare dynamic properties

And also remove a couple of unused properties.

Change-Id: I66ed64627dc475dc85da9d858a19317435d05532

2 years agowidget: Improve properties documentation
Daimona Eaytoy [Tue, 10 Sep 2019 12:05:14 +0000 (14:05 +0200)]
widget: Improve properties documentation

Explicitly declare all dynamic properties. Add docblocks for several
props. Remove the defaults when they're already set in the constructor.
Make TagMultiselectWidget use ?? like other widgets.

Change-Id: I889bf6f9e1bbe381f5bffb8ce1370c9e2e863520

2 years agoexternalstore: deprecate getLBInfo() dependency in ExternalStoreDB
Aaron Schulz [Tue, 27 Aug 2019 07:42:44 +0000 (00:42 -0700)]
externalstore: deprecate getLBInfo() dependency in ExternalStoreDB

Use the cluster and master server info array instead, when possible.

Also add initializeTable() method based on the one in addWiki.php.
This lets some internals be hidden from that script a bit more.

Bug: T231162
Change-Id: I694f12cc800684bcc13351021d9abc9a01bddfe9

2 years agoImprove MultiHttpClient connection concurrency and reuse
Aaron Schulz [Thu, 5 Sep 2019 15:30:36 +0000 (08:30 -0700)]
Improve MultiHttpClient connection concurrency and reuse

Use CURLMOPT_MAX_HOST_CONNECTIONS to enforce concurrent request limits.
This gives better concurrency than using naïve array_chunk() batches, which
were serialized and treated all URLs as pessimistically from the same host.

Allow connection reuse for multi-URL request batches. This avoids overhead
from reconnections and reduces the number of TIME_WAIT handles when many
batch operations happen in a short time frame. Previously, the use of the
CURLOPT_FORBID_REUSE flag meant that connections were cached but never
reused for multi-URL batches (only single-URL batches).

Connection limits can be verified by running large runMulti() batches
in an interactive shell and inspecting netstat for TCP connections.

Bug: T232128
Change-Id: I5c5f1eceb3fdb501a8f22f2b949756065f12379a

2 years agoMerge "Add a dedicated Exception for SessionOverflow"
jenkins-bot [Tue, 10 Sep 2019 09:24:45 +0000 (09:24 +0000)]
Merge "Add a dedicated Exception for SessionOverflow"

2 years agomaintenance: Fix broken userOptions maintenance script
Thiemo Kreuz [Tue, 10 Sep 2019 08:46:46 +0000 (10:46 +0200)]
maintenance: Fix broken userOptions maintenance script

Broken via I973cc60 just a few weeks ago.

Change-Id: I9e60b84acf6c2bf751e2e6cb8e97f0a7cba2764d

2 years agoMerge "Add a preference to require email for password resets"
jenkins-bot [Tue, 10 Sep 2019 08:41:00 +0000 (08:41 +0000)]
Merge "Add a preference to require email for password resets"

2 years agoAdd a dedicated Exception for SessionOverflow
Daimona Eaytoy [Sat, 7 Sep 2019 14:21:09 +0000 (16:21 +0200)]
Add a dedicated Exception for SessionOverflow

Instead of setting a custom property and checking via isset + count.

Change-Id: I087eeb2eee414218bbd6023ad1703fde22292281

2 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 10 Sep 2019 06:45:12 +0000 (08:45 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib122e0da175fc0a3c8ab85bc93c496ef4fb08ff9

2 years agoresourceloader: Remove comment about XmlJsCode wrapper
Fomafix [Tue, 10 Sep 2019 05:30:07 +0000 (07:30 +0200)]
resourceloader: Remove comment about XmlJsCode wrapper

The support for the XmlJsCode wrapper got removed in 23d066618d.

Change-Id: If14065277699aa9cca70107ff0174bd51f757c31

2 years agoMerge "filebackend: remove unneeded is_dir() call in FSFileBackend::doCleanInternal()"
jenkins-bot [Tue, 10 Sep 2019 03:37:43 +0000 (03:37 +0000)]
Merge "filebackend: remove unneeded is_dir() call in FSFileBackend::doCleanInternal()"

2 years agoMerge "filebackend: clean up some comments and remove unused FileBackendStoreOpHandle...
jenkins-bot [Tue, 10 Sep 2019 03:35:33 +0000 (03:35 +0000)]
Merge "filebackend: clean up some comments and remove unused FileBackendStoreOpHandle field"

2 years agoMerge "Cleanup and document some LCStoreDB fields"
jenkins-bot [Tue, 10 Sep 2019 03:32:45 +0000 (03:32 +0000)]
Merge "Cleanup and document some LCStoreDB fields"

2 years agoMerge "Move callers away from Title::GAID_FOR_UPDATE"
jenkins-bot [Tue, 10 Sep 2019 03:32:37 +0000 (03:32 +0000)]
Merge "Move callers away from Title::GAID_FOR_UPDATE"

2 years agofilebackend: remove unneeded is_dir() call in FSFileBackend::doCleanInternal()
Aaron Schulz [Sun, 8 Sep 2019 21:39:52 +0000 (14:39 -0700)]
filebackend: remove unneeded is_dir() call in FSFileBackend::doCleanInternal()

Change-Id: Ia630e2052edd31f0d9b6ed7068497dc4ae66d917

2 years agoMake most special pages class names match filename
Reedy [Sun, 14 Apr 2019 15:14:22 +0000 (16:14 +0100)]
Make most special pages class names match filename

Change-Id: I3a9f932acb7d9cf44a984b5d97f9fbc6b8670f7d

2 years agoCleanup and document some LCStoreDB fields
Aaron Schulz [Mon, 9 Sep 2019 22:50:33 +0000 (15:50 -0700)]
Cleanup and document some LCStoreDB fields

Change-Id: I1edcfbaa0889a84803a9d66d2bc6962664867650

2 years agoMerge "Update phpCharToUpper.json based on current differences"
jenkins-bot [Mon, 9 Sep 2019 23:15:26 +0000 (23:15 +0000)]
Merge "Update phpCharToUpper.json based on current differences"

2 years agoMerge "Mark passing non ObjectFactory spec to ApiModuleManager as deprecated"
jenkins-bot [Mon, 9 Sep 2019 20:25:30 +0000 (20:25 +0000)]
Merge "Mark passing non ObjectFactory spec to ApiModuleManager as deprecated"

2 years agoMerge "Fix use of GenderCache in ApiPageSet::processTitlesArray"
jenkins-bot [Mon, 9 Sep 2019 20:20:13 +0000 (20:20 +0000)]
Merge "Fix use of GenderCache in ApiPageSet::processTitlesArray"

2 years agoMove callers away from Title::GAID_FOR_UPDATE
Aaron Schulz [Thu, 4 Jul 2019 21:24:34 +0000 (14:24 -0700)]
Move callers away from Title::GAID_FOR_UPDATE

These callers just need to load some data from DB_MASTER.
Subsequent code needing that latest title data should also use the
required flags, rather than relying on flakey global cache state.

Change-Id: I53248ea4b5bf1cd953f956c41b8244831ec5ef04

2 years agoMerge "filebackend: replace wfTimestamp() calls with ConvertibleTimestamp::convert()"
jenkins-bot [Mon, 9 Sep 2019 20:10:19 +0000 (20:10 +0000)]
Merge "filebackend: replace wfTimestamp() calls with ConvertibleTimestamp::convert()"

2 years agoMerge "Revert and fix "Revert "Modify -—with-extensions to throw extension dependency...
jenkins-bot [Mon, 9 Sep 2019 20:05:01 +0000 (20:05 +0000)]
Merge "Revert and fix "Revert "Modify -—with-extensions to throw extension dependency errors"""

2 years agoMark passing non ObjectFactory spec to ApiModuleManager as deprecated
mainframe98 [Sun, 8 Sep 2019 10:28:55 +0000 (12:28 +0200)]
Mark passing non ObjectFactory spec to ApiModuleManager as deprecated

With Iee04afc27283547dd68d6db93f44ac2e0ebf1258, passing both the $class
and $factory parameter is deprecated in favor of just passing an
ObjectFactory spec as the third parameter.

Change-Id: I7b04d82c9daba52f5dc5e6c528739336279c7550

2 years agoFix use of GenderCache in ApiPageSet::processTitlesArray
Umherirrender [Sat, 22 Sep 2018 09:31:02 +0000 (11:31 +0200)]
Fix use of GenderCache in ApiPageSet::processTitlesArray

Title::getPrefixedText was called before the GenderCache was set up,
which lazy loads the cache for each title,
resulting in one query per user title

Splitted the foreach to fill the cache at a better location

Added a test for ApiPageSet to test that the gender cache is filled

Bug: T200238
Change-Id: I7972dd1bf3731a92328caab20e70d7b9b82c1f7c

2 years agoDeprecate the UserIsHidden hook
Thalia [Mon, 9 Sep 2019 15:57:17 +0000 (16:57 +0100)]
Deprecate the UserIsHidden hook

This was replaced by GetUserBlock in 7a5508573a.

Handlers in production were updated to use GetUserBlock in
Ibbcd3a239.

Bug: T228948
Change-Id: I3e6da73e595e2bd6a96600fe2a6dc68a54d06a2e

2 years agoMerge "api: Update QueryFilearchive to provide information to everyone"
jenkins-bot [Mon, 9 Sep 2019 19:29:48 +0000 (19:29 +0000)]
Merge "api: Update QueryFilearchive to provide information to everyone"

2 years agoMerge "Use ObjectFactory to create API modules"
jenkins-bot [Mon, 9 Sep 2019 19:25:42 +0000 (19:25 +0000)]
Merge "Use ObjectFactory to create API modules"

2 years agoMerge "Provide command to adjust phpunit.xml for code coverage"
jenkins-bot [Mon, 9 Sep 2019 19:25:32 +0000 (19:25 +0000)]
Merge "Provide command to adjust phpunit.xml for code coverage"

2 years agoMerge "maintenance: Explicitly declare all used properties"
jenkins-bot [Mon, 9 Sep 2019 19:11:52 +0000 (19:11 +0000)]
Merge "maintenance: Explicitly declare all used properties"

2 years agoAdd a preference to require email for password resets
Max Semenik [Thu, 5 Sep 2019 01:12:09 +0000 (18:12 -0700)]
Add a preference to require email for password resets

The actual functonality will come in a later commit.

Bug: T231495
Change-Id: I9977b0d51a2b89b79c199bc4423f123e581e2a2f

2 years agoMerge "Remove spurious `@class` tags in two files"
jenkins-bot [Mon, 9 Sep 2019 18:51:39 +0000 (18:51 +0000)]
Merge "Remove spurious `@class` tags in two files"

2 years agoUse ObjectFactory to create API modules
mainframe98 [Fri, 6 Sep 2019 11:38:55 +0000 (13:38 +0200)]
Use ObjectFactory to create API modules

This will allow constructing API modules that need services.

This overhauls some of the internals of the ApiModuleManager,
but the public interface remains unchanged.
The $class parameter of addModule, (now called $spec)
also allows passing an array with the spec of the module.
Note that this spec requires the attribute 'class' to be present,
even when 'factory' is specified. This is the same as before,
where $class was always required.

In a perfect DI world ObjectFactory would be injected into
ApiMain::__construct and ApiMain would pass that to its instance
of ApiModuleManager, but that is currently not possible, so for now
it is injected in ApiModuleManager by having ApiMain::__construct
call the service locator.

Bug: T222388
Change-Id: Iee04afc27283547dd68d6db93f44ac2e0ebf1258

2 years agoMerge "Special:Contributions - use `label` instead of `radioLabel` for username"
jenkins-bot [Mon, 9 Sep 2019 18:49:08 +0000 (18:49 +0000)]
Merge "Special:Contributions - use `label` instead of `radioLabel` for username"

2 years agoMerge "Use @phan-template instead of @template"
jenkins-bot [Mon, 9 Sep 2019 18:41:03 +0000 (18:41 +0000)]
Merge "Use @phan-template instead of @template"

2 years agoMerge "DifferenceEngine: Use quickUserCan for display of rollback link"
jenkins-bot [Mon, 9 Sep 2019 18:39:39 +0000 (18:39 +0000)]
Merge "DifferenceEngine: Use quickUserCan for display of rollback link"

2 years agoMerge "mediawiki.util: Move mw.RegExp over as well to simplify migration"
jenkins-bot [Mon, 9 Sep 2019 18:28:51 +0000 (18:28 +0000)]
Merge "mediawiki.util: Move mw.RegExp over as well to simplify migration"

2 years agoRemove spurious `@class` tags in two files
Timo Tijhof [Mon, 9 Sep 2019 18:00:28 +0000 (19:00 +0100)]
Remove spurious `@class` tags in two files

This was only used in two PHP files in all of core. It is not
needed (the block above the class keyword is naturally for that
class) and only emits a warning from Doxygen:

> PHPVersionCheck.php:35: warning: missing argument after \class.
> SpecialPageData.php:28: warning: missing argument after \class.

This is unlike JSDuck, where it is used to differentiate a function
from a constructor/class.

In Doxygen, `@class` is only used to create a virtual class within
the docs that isn't explicitly in an indexed file, and thus
requires a name.

Bug: T232104
Change-Id: Ie504a8e2b72be8f370dc0c90da6a03f64d93df2d

2 years agoMerge "Follow-up 8697ba8: No need for two dependencies on the same module"
jenkins-bot [Mon, 9 Sep 2019 17:56:26 +0000 (17:56 +0000)]
Merge "Follow-up 8697ba8: No need for two dependencies on the same module"

2 years agoUse @phan-template instead of @template
Daimona Eaytoy [Mon, 9 Sep 2019 17:29:22 +0000 (19:29 +0200)]
Use @phan-template instead of @template

And move it after the method description to avoid doxygen messing up
with it.

Change-Id: I0f93050b390ffab1a88cbdc7c2d7a7a2a50ce3bf

2 years agomediawiki.util: Move mw.RegExp over as well to simplify migration
Timo Tijhof [Mon, 9 Sep 2019 17:23:34 +0000 (18:23 +0100)]
mediawiki.util: Move mw.RegExp over as well to simplify migration

Follows-up 8697ba835463c94. In order to allow for a simpler migration
and to keep compatibility over 1 stable release at least, deprecate
the module only, and keep the alias in the destination module.

This means 'mediawiki.RegExp' can be replaced with 'mediawiki.util',
without it causing code to break. It will still warn about
the method being deprecated, which can then be fixed separately,
depending on whether compat is needed.

This is mainly to reduce risk from mass migrations in user scripts
and gadgets (to do in two separate passes).

Bug: T218339
Change-Id: I07ba0a481b83fe704be3a17199070bafba4d5233

2 years agoMerge "mediawiki.Title: Minor optimizations for mw.Title JavaScript code"
jenkins-bot [Mon, 9 Sep 2019 17:16:56 +0000 (17:16 +0000)]
Merge "mediawiki.Title: Minor optimizations for mw.Title JavaScript code"

2 years agoMerge "mediawiki.Title: Change internal 'title' field to include file extension"
jenkins-bot [Mon, 9 Sep 2019 17:15:29 +0000 (17:15 +0000)]
Merge "mediawiki.Title: Change internal 'title' field to include file extension"

2 years agoMerge "Fix typo in ChangesListSpecialPageTest"
jenkins-bot [Mon, 9 Sep 2019 17:10:43 +0000 (17:10 +0000)]
Merge "Fix typo in ChangesListSpecialPageTest"

2 years agoMerge "Mostly drop old pre-actor user schemas"
jenkins-bot [Mon, 9 Sep 2019 17:09:39 +0000 (17:09 +0000)]
Merge "Mostly drop old pre-actor user schemas"

2 years agoFollow-up 8697ba8: No need for two dependencies on the same module
James D. Forrester [Mon, 9 Sep 2019 17:00:39 +0000 (10:00 -0700)]
Follow-up 8697ba8: No need for two dependencies on the same module

Change-Id: I1ac1cbe20bc66092ce15d426d0d6a8e0c8c8d815

2 years agoMerge "maintenance/Maintenance.php: Fix MW_ENTRY_POINT definition (followup I24099f4c)"
jenkins-bot [Mon, 9 Sep 2019 16:55:17 +0000 (16:55 +0000)]
Merge "maintenance/Maintenance.php: Fix MW_ENTRY_POINT definition (followup I24099f4c)"

2 years agoMerge "maintenance/getReplicaServer.php: Remove reference to long-deleted config...
jenkins-bot [Mon, 9 Sep 2019 16:33:19 +0000 (16:33 +0000)]
Merge "maintenance/getReplicaServer.php: Remove reference to long-deleted config var"

2 years agomaintenance/Maintenance.php: Fix MW_ENTRY_POINT definition (followup I24099f4c)
Brad Jorsch [Mon, 9 Sep 2019 15:56:57 +0000 (11:56 -0400)]
maintenance/Maintenance.php: Fix MW_ENTRY_POINT definition (followup I24099f4c)

Quotes were omitted. This currently works in PHP, but raises a warning.

Change-Id: I4c9ce4b5ea9fb9f30215f646cc8fa60db0ed7d1c

2 years agoFix typo in ChangesListSpecialPageTest
Brad Jorsch [Wed, 7 Aug 2019 21:37:19 +0000 (17:37 -0400)]
Fix typo in ChangesListSpecialPageTest

Change-Id: I812853ccbb8e0747bf5dbe5650d5b3ebb4dd38b5

2 years agoMostly drop old pre-actor user schemas
Brad Jorsch [Tue, 23 Jul 2019 17:40:52 +0000 (13:40 -0400)]
Mostly drop old pre-actor user schemas

This removes most of the pre-actor user and user_text columns, and the
$wgActorTableSchemaMigrationStage setting that used to determine
whether the columns were used.

rev_user and rev_user_text remain in the code, as on Wikimedia wikis the
revision table is too large to alter at this time. A future change will
combine that with the removal of rev_comment, rev_content_model, and
rev_content_format (and the addition of rev_comment_id and rev_actor).

ActorMigration's constructor continues to take a $stage parameter, and
continues to have the logic for handling it, for the benefit of
extensions that might need their own migration process. Code using
ActorMigration for accessing the core fields should be updated to use
the new actor fields directly. That will be done for in a followup.

Bug: T188327
Change-Id: Id35544b879af1cd708f3efd303fce8d9a1b9eb02

2 years agoDifferenceEngine: Use quickUserCan for display of rollback link
Daimona Eaytoy [Fri, 12 Apr 2019 09:17:57 +0000 (11:17 +0200)]
DifferenceEngine: Use quickUserCan for display of rollback link

Title::userCan is too expensive for this, as it queries the master DB
just to decide whether a link should be shown.
The DBPerformance warning for this is seen roughly 8000 times per day on
logstash.

Bug: T232258
Change-Id: I33eab493273ed4790645e338c83993043e76e1d7

2 years agoMerge "Add MW_REST_API and MW_ENTRY_POINT"
jenkins-bot [Mon, 9 Sep 2019 15:29:21 +0000 (15:29 +0000)]
Merge "Add MW_REST_API and MW_ENTRY_POINT"

2 years agomaintenance/getReplicaServer.php: Remove reference to long-deleted config var
Brad Jorsch [Mon, 9 Sep 2019 14:22:43 +0000 (10:22 -0400)]
maintenance/getReplicaServer.php: Remove reference to long-deleted config var

$wgAllDBsAreLocalhost was removed 3 years ago, in I54b23654. This
maintenance script kept working because it just saw null for the
variable.

But then Id67d0759 changed the code to access it via Config, which does
checking for accessing of nonexistent config vars and so broke things.

Bug: T232268
Change-Id: I4fc39cccfd9041c76f734a1a85c2b34fc84218f0

2 years agoMerge "Make DBAccessBase use DBConnRef, rename $wiki, and hide getLoadBalancer()"
jenkins-bot [Mon, 9 Sep 2019 13:19:04 +0000 (13:19 +0000)]
Merge "Make DBAccessBase use DBConnRef, rename $wiki, and hide getLoadBalancer()"

2 years agoProvide command to adjust phpunit.xml for code coverage
Kosta Harlan [Sun, 21 Jul 2019 18:34:23 +0000 (20:34 +0200)]
Provide command to adjust phpunit.xml for code coverage

Our current recommendation for adjusting PHPUnit configuration for
extension code coverage reports is to manually modify
tests/phpunit/suite.xml. This is cumbersome and annoying, since
suite.xml is version controlled.

This patch proposes a composer script to simplify editing
the (non-version controlled) phpunit.xml config in the root of the
MediaWiki repo. It is useful if you are interested in generating
code coverage reports based on unit tests only, not integration tests.

Usage: composer phpunit:coverage-edit -- extensions/GrowthExperiments

When you're done, you can run `rm phpunit.xml` to switch back to the
default phpunit.xml.dist.

The script will use the default includes/src/maintenance directories,
but a future improvement would be to identify the relevant directories
via the AutoloadClasses property of extension.json.

Another improvement would be to provide an option for passing
arbitrary paths in core, in case you are working on tests for a
specific class and want to generate coverage reports instantly.

We could probably also remove
dockerfiles/quibble-coverage/phpunit-suite-edit.py (which inspired
this patch) and use composer phpunit:coverage-edit instead.

Bug: T100294
Change-Id: Ia0ef41f67ca4a64b0d1ca0ddcee488c29630af0b

2 years agoMerge "Support the creation of special pages with services injected"
jenkins-bot [Mon, 9 Sep 2019 12:21:24 +0000 (12:21 +0000)]
Merge "Support the creation of special pages with services injected"

2 years agofilebackend: clean up some comments and remove unused FileBackendStoreOpHandle field
Aaron Schulz [Mon, 9 Sep 2019 11:44:36 +0000 (04:44 -0700)]
filebackend: clean up some comments and remove unused FileBackendStoreOpHandle field

Change-Id: I67ae874219e0056f9173d653c3dc272099b9b2e8

2 years agomaintenance: Explicitly declare all used properties
Daimona Eaytoy [Mon, 9 Sep 2019 09:11:50 +0000 (11:11 +0200)]
maintenance: Explicitly declare all used properties

All uses were checked with codesearch, and the visibility was chosen as
strict as possible.

Change-Id: I56666299cc04ccc418e05949422876583982eb3c

2 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 9 Sep 2019 06:27:07 +0000 (08:27 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ie7693a53321a045a50fca3d41b0c168717db7dd9

2 years agoMerge "Remove support for wgUseESI"
jenkins-bot [Sun, 8 Sep 2019 22:27:43 +0000 (22:27 +0000)]
Merge "Remove support for wgUseESI"

2 years agofilebackend: replace wfTimestamp() calls with ConvertibleTimestamp::convert()
Aaron Schulz [Sun, 8 Sep 2019 22:01:45 +0000 (15:01 -0700)]
filebackend: replace wfTimestamp() calls with ConvertibleTimestamp::convert()

Change-Id: I4bef0fc377a928cf403d2bc187ed0a10154feb18

2 years agoparser: Declare some dynamic properties
Daimona Eaytoy [Sun, 8 Sep 2019 17:18:27 +0000 (19:18 +0200)]
parser: Declare some dynamic properties

Mostly via the @property annotation. This is to make phan a little
happier.

Change-Id: I3fde33955240dab20870821e9db93caba163845b

2 years agoMerge "Add docblocks to a bunch of methods"
jenkins-bot [Sun, 8 Sep 2019 18:58:27 +0000 (18:58 +0000)]
Merge "Add docblocks to a bunch of methods"

2 years agoMerge "RequestContext: Declare the dynamic property for language recursion"
jenkins-bot [Sun, 8 Sep 2019 18:57:35 +0000 (18:57 +0000)]
Merge "RequestContext: Declare the dynamic property for language recursion"

2 years agoMerge "auth: Use phan templates for getRequestByClass"
jenkins-bot [Sun, 8 Sep 2019 18:56:38 +0000 (18:56 +0000)]
Merge "auth: Use phan templates for getRequestByClass"

2 years agoAdd docblocks to a bunch of methods
Daimona Eaytoy [Sun, 8 Sep 2019 16:59:52 +0000 (18:59 +0200)]
Add docblocks to a bunch of methods

Copied from I014ea7f048862cc8cc387a68bf0f1cc5acbd9c6e.

Change-Id: Ic3216386af173cfb9cbffda0826879829e52ffbb

2 years agoRequestContext: Declare the dynamic property for language recursion
Daimona Eaytoy [Sun, 8 Sep 2019 16:50:13 +0000 (18:50 +0200)]
RequestContext: Declare the dynamic property for language recursion

Change-Id: I601f98190cb8f760541ba1f05a3070fc43c25ccb

2 years agoMerge "languages: Add NS_CATEGORY and #REDIRECT for hyw"
jenkins-bot [Sun, 8 Sep 2019 17:48:57 +0000 (17:48 +0000)]
Merge "languages: Add NS_CATEGORY and #REDIRECT for hyw"

2 years agoauth: Use phan templates for getRequestByClass
Daimona Eaytoy [Sat, 7 Sep 2019 13:33:24 +0000 (15:33 +0200)]
auth: Use phan templates for getRequestByClass

Phan is clever enough to understand when the return value depends on the
name of the string passed in. This avoids lots of @phan-var annotations
in all subclasses.

Note that PHPCS rejects @template, ref T232256.

Change-Id: I7b7c7fae9c80320cad41bedc2972a3a5e22e19b0

2 years agoMerge "filebackend: use self:: instead of FileBackend:: for some constant uses"
jenkins-bot [Sun, 8 Sep 2019 14:38:17 +0000 (14:38 +0000)]
Merge "filebackend: use self:: instead of FileBackend:: for some constant uses"

2 years agofilebackend: use self:: instead of FileBackend:: for some constant uses
Aaron Schulz [Sun, 8 Sep 2019 06:33:49 +0000 (23:33 -0700)]
filebackend: use self:: instead of FileBackend:: for some constant uses

Change-Id: Iae82a074ef9da3c36b34713d31ec65407d2a90b7

2 years agoSupport the creation of special pages with services injected
mainframe98 [Fri, 6 Sep 2019 09:21:29 +0000 (11:21 +0200)]
Support the creation of special pages with services injected

Now that the ObjectFactory library supports object creation with
services (T222409), the special page factory can use the object
factory to create special pages based off a spec, allowing the
creation of special pages that need services injected.

The object factory now also handles constructing from class name
and from callable.

This also deprecates providing the special page list with an
instance of SpecialPage, which hasn't been necessary since
r15031.

Bug: T222388
Change-Id: Iabb78ce5c98cfb3b586644be35d984871cb750cb

2 years agoMerge "recompressTracked.php: Fix typehint of RecompressTracked::dispatch()"
jenkins-bot [Sun, 8 Sep 2019 04:34:00 +0000 (04:34 +0000)]
Merge "recompressTracked.php: Fix typehint of RecompressTracked::dispatch()"

2 years agoMerge "parser: Document PPFrame_DOM::expand() as taking DOMNodeList"
jenkins-bot [Sun, 8 Sep 2019 04:29:39 +0000 (04:29 +0000)]
Merge "parser: Document PPFrame_DOM::expand() as taking DOMNodeList"

2 years agoMerge "Document $file in FileDeleteForm as LocalFile (not File)"
jenkins-bot [Sun, 8 Sep 2019 04:29:32 +0000 (04:29 +0000)]
Merge "Document $file in FileDeleteForm as LocalFile (not File)"

2 years agoMerge "watcheditem: Fix bad $options param in NoWriteWatchedItemStore::countWatchersM...
jenkins-bot [Sun, 8 Sep 2019 04:26:31 +0000 (04:26 +0000)]
Merge "watcheditem: Fix bad $options param in NoWriteWatchedItemStore::countWatchersMultiple"

2 years agoMerge "preprocessDump.php: Fix invalid Preprocessor instantiation"
jenkins-bot [Sun, 8 Sep 2019 04:21:32 +0000 (04:21 +0000)]
Merge "preprocessDump.php: Fix invalid Preprocessor instantiation"

2 years agoRemove support for wgUseESI
Timo Tijhof [Sun, 8 Sep 2019 04:11:22 +0000 (05:11 +0100)]
Remove support for wgUseESI

Experimental feature deprecated since 1.33 (d63684a064b09).

Change-Id: I9bab4ad1cd1f2c80a3dfcccdf99ed011c9c8a440

2 years agorecompressTracked.php: Fix typehint of RecompressTracked::dispatch()
Umherirrender [Wed, 4 Sep 2019 20:12:38 +0000 (22:12 +0200)]
recompressTracked.php: Fix typehint of RecompressTracked::dispatch()

Follows-up 4a55e578ff8d73e. This must be the same type as
RecompressTracked::dispatchToReplica().

Caught by PhanTypeMismatchArgument, to be enabled in I34d65fe3ff1916f.

Change-Id: Ifff0d92752e6664d7745efeb4840c8b5ddb974a4

2 years agoparser: Document PPFrame_DOM::expand() as taking DOMNodeList
Umherirrender [Wed, 4 Sep 2019 18:28:46 +0000 (20:28 +0200)]
parser: Document PPFrame_DOM::expand() as taking DOMNodeList

Caught by PhanTypeMismatchArgument, to be enabled with I34d65fe3ff191.

Change-Id: Ifa41f1c8a099a8d6c4e37052c8d93dc8473ec4f0

2 years agoDocument $file in FileDeleteForm as LocalFile (not File)
Umherirrender [Wed, 4 Sep 2019 18:46:57 +0000 (20:46 +0200)]
Document $file in FileDeleteForm as LocalFile (not File)

Deletion is only possible for files on the local wiki, so this is always
a LocalFile. The static self::doDelete already requires a LocalFile.

Caught by PhanTypeMismatchArgument, to be enabled with I34d65fe3ff191.

Change-Id: Iee0774340208b493b075085485343e05f922751c

2 years agowatcheditem: Fix bad $options param in NoWriteWatchedItemStore::countWatchersMultiple
Umherirrender [Sat, 29 Jun 2019 21:33:36 +0000 (23:33 +0200)]
watcheditem: Fix bad $options param in NoWriteWatchedItemStore::countWatchersMultiple

countVisitingWatchersMultiple is documented to take int|null as second
parameter, but array is given here. The options array is documented to
have a minimumWatchers key, so fix it by using that key.

Caught by PhanTypeMismatchArgument, to be enabled with I34d65fe3ff191.

Change-Id: I0271edae3442fc1adafabf623beeb7f2c4411d6c

2 years agopreprocessDump.php: Fix invalid Preprocessor instantiation
Umherirrender [Fri, 5 Jul 2019 20:16:26 +0000 (22:16 +0200)]
preprocessDump.php: Fix invalid Preprocessor instantiation

The Preprocessor constructor needs a Parser object,
not the maintenance object itself.

Change-Id: I0f60b968b52d29c0e7484409cc4aa790ca391303

2 years agoAPI: Remove unused asignment to $titleProvided in ApiExpandTemplates
Fomafix [Fri, 30 Aug 2019 19:10:30 +0000 (21:10 +0200)]
API: Remove unused asignment to $titleProvided in ApiExpandTemplates

The variable $titleProvided is not used in the following code.

Change-Id: I879ecfb589616882ba7193943f843f9226277f3e

2 years agoMake DBAccessBase use DBConnRef, rename $wiki, and hide getLoadBalancer()
Aaron Schulz [Tue, 16 Jul 2019 03:33:38 +0000 (20:33 -0700)]
Make DBAccessBase use DBConnRef, rename $wiki, and hide getLoadBalancer()

Note that only one extension uses this class and should not be affected.
Also, make the constructor take an optional LoadBalancer for DI.

Change-Id: Ibb7192ac199427266d7e3f3f14437d0495061911

2 years agomediawiki.Title: Minor optimizations for mw.Title JavaScript code
Thiemo Kreuz [Mon, 13 May 2019 08:41:47 +0000 (10:41 +0200)]
mediawiki.Title: Minor optimizations for mw.Title JavaScript code

None of these changes implies any functional change. They are all
only done to
* make the code shorter and more light-weight.
* make the code easier to read and to maintain.

Change-Id: I5eee3db59ff352069f6b613a5ca051773338213c

2 years agomediawiki.Title: Change internal 'title' field to include file extension
Thiemo Kreuz [Mon, 13 May 2019 09:20:32 +0000 (11:20 +0200)]
mediawiki.Title: Change internal 'title' field to include file extension

I found the separation of 'ext' from 'title' very suprising, and an actual
source of errors, confusion and misunderstandings.

Before this change, the private parse() helper function returned a "title"
property that did not contain the real title, but only the part of a
file-related title without its file extension, basically assuming
every title is a file name. And for normal titles, every method had to
remember to combine "title" and ext".

This patch moves the file name and file extension extraction code to the
only places where it is actually needed: The two methods getName() and
getExtension() return file name and extension as separate substrings.
Note how this code is barely used anywhere. Almost all code (except a
few places in UploadWizard, MultiMediaViewer, and such) works with the
full title. With this patch constructing mw.Title objects will become a
little faster on average.

Change-Id: I6618118557b12224f2405d83f539bee54646bb63

2 years agoMerge "Make wgDisableAnonTalk disable anon links in automatic edit summaries"
jenkins-bot [Sun, 8 Sep 2019 02:54:56 +0000 (02:54 +0000)]
Merge "Make wgDisableAnonTalk disable anon links in automatic edit summaries"

2 years agoMerge "resourceloader: Add $conf parameter to the 'ResourceLoaderGetConfigVars' hook"
jenkins-bot [Sun, 8 Sep 2019 02:37:44 +0000 (02:37 +0000)]
Merge "resourceloader: Add $conf parameter to the 'ResourceLoaderGetConfigVars' hook"

2 years agofilebackend: optimize 'move' in FSFileBackend to avoid is_file() calls
Aaron Schulz [Sat, 7 Sep 2019 08:25:19 +0000 (01:25 -0700)]
filebackend: optimize 'move' in FSFileBackend to avoid is_file() calls

Also, remove clearstatcache() call that is redundant with moveInternal()

Change-Id: I56e6c3d91427e7d0b49011f884b77daa5eb0b61c

2 years agofilebackend: optimize 'delete' for FSFileBackend to avoid is_file() calls
Aaron Schulz [Sat, 7 Sep 2019 06:21:48 +0000 (23:21 -0700)]
filebackend: optimize 'delete' for FSFileBackend to avoid is_file() calls

This also should reduce the chance of warnings due to race conditions

Change-Id: I06b6bcc5e0f009bb3d5135591d13ff098710a5b3

2 years agofilebackend: optimize the chmod() calls in FSFileBackend
Aaron Schulz [Sat, 7 Sep 2019 05:58:29 +0000 (22:58 -0700)]
filebackend: optimize the chmod() calls in FSFileBackend

Bypass the calls in Windows to avoid the stat overhead. The file system
will almost always be NTFS, in which case it can't do anything since the
ACL model is totally different than that of Unix.

Add chmod calls to the existing command in FSFileOpHandle rather than
doing them all serially afterwards.

Use AtEase class for more simple error suppression cases.

Change-Id: Ib4fae9a1bf64c1a9dfde8debe724556633a5532c