Commit graph

8313 commits

Author SHA1 Message Date
James D. Forrester
b16be7a36c Namespace TitleFormatter under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: Ic2d59eb6764b1a273ed7162ecabf641f638b8f66
2023-09-19 05:17:18 +00:00
James D. Forrester
a8a6cfd966 Namespace NamespaceInfo under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: Ibe103cd362535d3cb94cb8931e95fc74099d1497
2023-09-19 05:17:04 +00:00
jenkins-bot
30f54f6322 Merge "Namespace TitleValue under \MediaWiki\Title" 2023-09-18 21:34:29 +00:00
jenkins-bot
3751d36211 Merge "Namespace remaining 'specialpage' files under \MediaWiki\SpecialPage" 2023-09-18 21:06:01 +00:00
jenkins-bot
7201f953ac Merge "Namespace 'special' Pagers under \MediaWiki\Pager" 2023-09-18 21:01:17 +00:00
James D. Forrester
94ece673b2 Namespace TitleValue under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: I4c901d5c32696d8334ec30cede7d9b6f3d8d645e
2023-09-18 18:24:39 +01:00
James D. Forrester
459cbb0494 Namespace remaining 'specialpage' files under \MediaWiki\SpecialPage
SpecialPageFactory is already here, but none of the others were yet.

Bug: T166010
Change-Id: I9689bf0a1ab329625e23669b99f019b96295fffd
2023-09-18 18:23:13 +01:00
James D. Forrester
5088626212 Namespace 'special' Pagers under \MediaWiki\Pager
They're under 'specials' because that's where they're mostly used,
but they're just another kind of Pager (shown by their use outwith
the MediaWiki\Specials hierarchy, which is a bad code smell for us
to review later).

Bug: T166010
Change-Id: Iad3f91582b723c1e6679525aa852ffdfd8c6d5ba
2023-09-18 18:23:13 +01:00
C. Scott Ananian
d421ab57f8 Remove ParserOutput::addOutputHook() and related code
ParserOutput::addOutputHook() has been deprecated since 1.38, and without
any calls to ::addOutputHook() the associated ::getOutputHooks() and
$wgParserOutputHooks configuration do nothing.

Bug: T292321
Bug: T305161
Change-Id: Ib770c680d5e0697980e7e36a323ec56ba1d806b8
2023-09-18 11:34:02 -04:00
Translation updater bot
c06cbd39b9 Localisation updates from https://translatewiki.net.
Change-Id: I776312bb220a5dcf9d5ff33bde2242d70f0b8a8b
2023-09-18 07:01:21 +00:00
James D. Forrester
0fd7b663c5 API Help: Note that parameters may be inherited from other context
Most notably, uselang can be applied to a lot of API requests, but
is not automatically listed, & is very frequently not mentioned in
the examples given.

Bug: T265734
Change-Id: Idac9cec817a4eec6dd063310e4185014b38f6db3
2023-09-14 19:46:17 +00:00
James D. Forrester
870f7c3f1a Namespace SpecialVersion under \MediaWiki\Specials
Change-Id: Ibeb181c653dac3796c44b36c8ff9f2ed572d5f42
2023-09-14 19:25:51 +00:00
James D. Forrester
87f2b083af Namespace SpecialU* under \MediaWiki\Specials
Change-Id: I75b04a7a65f8d37da12d2ed3892e065e97c92437
2023-09-14 19:24:08 +00:00
Máté Szabó
3f294751b2 ApiParse: Coerce image links to string
When ApiParse is used to parse a page containing numeric image links
like [[File:1]], those image links are returned in the "images" section
as numbers, not strings. This is due to a longstanding PHP feature where
numeric strings get converted into numbers when used as keys in an
associative array. So, coerce them back to strings.

While numeric image links seem rather useless, they still occur in the
wild, whether by design or by accident, and may break API consumers that
expect to deal with strings here.

Bug: T346265
Change-Id: I9bd3813afd1867d0ba9c7ef480ad5e6b062c1e94
2023-09-13 20:06:31 +02:00
James D. Forrester
f17ccb46ae Namespace SpecialP* under \MediaWiki\Specials
Change-Id: I10211c4406b1eedd6e5de63f1e57868f924640db
2023-09-13 14:41:15 +00:00
Translation updater bot
e8635ff3da Localisation updates from https://translatewiki.net.
Change-Id: I646a6cf2ae3d549e784fd9394a222bed31e021c1
2023-09-13 08:16:42 +02:00
Amir Sarabadani
ec1acd8df4 filerepo: Switch to use IConnectionProvider where possible
It uses db factory in some places and that should be properly cleaned up

Bug: T330641
Change-Id: I310199ce7b2e46d08392204d26e77690dc6afd20
2023-09-12 00:08:38 +00:00
Amir Sarabadani
5bd33d46ef Reorg: Move WebRequest to includes\Request
This has been approved as part of RFC T166010

Bug: T321882
Change-Id: I6bbdbbe6ea48cc1f50bc568bb8780fc7c5361a6f
2023-09-11 21:44:34 +01:00
Amir Sarabadani
52f33d7d72 Bump phan to 0.13.0
Change-Id: I57c25d953700ca1cd97cc71ec2a28cbeb9ee875f
2023-09-11 19:22:44 +02:00
jenkins-bot
e4eb4f6f1a Merge "TagsDef: inject ChangeTagsStore" 2023-09-11 11:28:56 +00:00
Translation updater bot
4e3b359501 Localisation updates from https://translatewiki.net.
Change-Id: Id36a014b1ca010064faa1a118831c63d33dd0e11
2023-09-11 08:33:50 +02:00
DannyS712
4895985c8a TagsDef: inject ChangeTagsStore
Bug: T245964
Change-Id: I1ff9ed3188fb8d45ecfde8b4b1e269c5d482ea1f
2023-09-10 18:43:28 +00:00
jenkins-bot
97668ae6cc Merge "api: Default changecontentmodel summary to empty" 2023-09-10 13:28:27 +00:00
Daimona Eaytoy
3f35734ac0 Remove redundant empty() constructs
empty() only makes sense when the expression it checks is possibly
undefined, otherwise it's equivalent to a truthiness check with the
additional downside of suppressing errors when it's not wanted.

Replace it with simple truthiness checks, using strict comparison when
that seems to help with polymorphic variables.

These were caught by a bespoke phan plugin.

Change-Id: I52999e5286a0d9ad70b0da40b41b9f998ecb990e
2023-09-08 23:18:11 +02:00
Lucas Werkmeister
36cbb1cdc4 api: Default changecontentmodel summary to empty
Instead of crashing because ContentModelChange requires a non-null
string now.

Bug: T341595
Change-Id: Ic487213be90454db6a0f2038b06f2b30ca32bc77
2023-09-08 13:18:36 +02:00
Translation updater bot
9218665384 Localisation updates from https://translatewiki.net.
Change-Id: I482293c1de66ce57ea91361042a1a243a813ad7d
2023-09-07 10:29:43 +02:00
jenkins-bot
796f3b174a Merge "Blocks documentation review" 2023-09-06 19:39:13 +00:00
jenkins-bot
bbfa65643f Merge "ArchivedRevisionLookup: Allow lookups using just the revision ID" 2023-09-06 18:43:32 +00:00
jenkins-bot
30b06ec9c8 Merge "General whitespace clean-up of tabs followed by multiple spaces" 2023-09-06 14:14:51 +00:00
James D. Forrester
35b934ffcb General whitespace clean-up of tabs followed by multiple spaces
Change-Id: I22090062274dceec96d43e23eb227a7e3b1e36fa
2023-09-06 14:28:43 +01:00
Amir Sarabadani
049b34b41c Introduce RevisionSelectQueryBuilder
Deprecating RevisionStore::getQueryInfo() and cleaning up a lot of code

Also removing a brittle test that wasn't really testing anything.

Bug: T344971
Change-Id: Ifd690dc8f030f86e3567a717eaeb830cb6dc703b
2023-09-06 12:30:38 +02:00
jenkins-bot
53858466f1 Merge "ApiMain: Do not allow negative max age" 2023-09-06 10:08:01 +00:00
Translation updater bot
3481a0b7f7 Localisation updates from https://translatewiki.net.
Change-Id: I44e8fc820c12c7601c622062741bdf2227f4f909
2023-09-06 07:11:25 +00:00
Tim Starling
1ee50f1a77 Blocks documentation review
* Use a consistent single-line comment style.
* Start each sentence with a capital letter.
* Use imperative mood.
* Put a space between the adjective and the noun in "hardblock" and
  "rangeblock".
* Capitalise acronyms.
* Break long lines.
* Remove excessively obvious or off-topic comments.
* Indent the non-initial lines of a multi-line @ command.
* Don't try to apply @deprecated to a parameter. Doxygen and PHPStorm
  interpret this as method deprecation.

Bug: T345683
Change-Id: I7df126f7a031dde241dd46f66e5e83722f9b383c
2023-09-06 13:48:07 +10:00
jenkins-bot
4889d1d090 Merge "Reorg: Move three output related classes to includes/Output/" 2023-09-05 21:17:02 +00:00
Amir Sarabadani
d8e542abf9 Reorg: Move three output related classes to includes/Output/
And namesapce them:
 - StreamFile
 - OutputHandler
 - OutputPage

Bug: T321882
Change-Id: Iedf8d88c595e580f2d8f0734c92aa5c45618ba33
2023-09-05 19:36:42 +01:00
Amir Sarabadani
06fa7a9107 ExternalLinks: Drop migration code
Anything that writes or reads from now-dropped columns

Bug: T312666
Change-Id: Ic1c69de717bfa03bba94e97dabad9e717ba13fd6
2023-09-05 16:43:18 +02:00
Alexander Vorwerk
b0adbad624 ApiMain: Do not allow negative max age
Bug: T345544
Change-Id: I79b8bc8204871ef629b302cc870c9a22f60883f7
2023-09-04 10:05:36 +00:00
Translation updater bot
b57381e951 Localisation updates from https://translatewiki.net.
Change-Id: I9182be5ee4bf9a8472daf1cce0fa3446da4d2052
2023-09-04 08:11:51 +02:00
Bartosz Dziewoński
2911de600f ArchivedRevisionLookup: Allow lookups using just the revision ID
A unique index on ar_rev_id was added in T193180 (2019), allowing
revisions of deleted pages to be reliably looked up by just their ID.

Use the improved getArchivedRevisionRecord() method in a few places
that previously had to use manual queries.

Bug: T251066
Change-Id: I9352f64952ac4b803d76e9e72f88a01be7317c56
2023-09-02 01:56:20 +00:00
Translation updater bot
4fa0feeeba Localisation updates from https://translatewiki.net.
Change-Id: Ib5312d0a53bbada38a665c81546af4c25d9f520e
2023-09-01 08:13:22 +02:00
jenkins-bot
e4e82da25f Merge "Api*Search: Remove some redundant caching" 2023-08-30 16:08:29 +00:00
Bartosz Dziewoński
d2374ceb61 Api*Search: Remove some redundant caching
The result of getAllowedParams() is already cached in
ApiBase::extractRequestParams(). Remove the only other call, which was
unnecessary anyway, because the format is already validated.

Change-Id: I5769a0209ef9f264bbd43c21f1328ac7cff14c4f
2023-08-30 17:36:36 +02:00
Translation updater bot
9ee7ebbb12 Localisation updates from https://translatewiki.net.
Change-Id: If0d47fb3ef438d8c656cd6633d4dda40419a656e
2023-08-30 08:18:21 +02:00
Umherirrender
778d266c2e api: Use ParserFactory on module creation
Change "Parser" to "ParserFactory" in object specs
and get a instance when needed

Bug: T343070
Change-Id: I9b65c272726bb0035f4cdca4fbf417a0a11375cb
2023-08-29 20:19:32 +02:00
Translation updater bot
ad2734f923 Localisation updates from https://translatewiki.net.
Change-Id: I99a645b16cde48c728bbaeea0cfb422f650f9fa2
2023-08-29 08:12:34 +02:00
Bartosz Dziewoński
365a588238 Use real type hints for services etc. in api/ except ApiQuery*.php
Mostly used find-and-replace:

Find:
/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?)[\s\*]+/\s*(private|protected|public) (\$[a-z]\w+;\n)((?=\s*/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?))\n|)
Replace with:
\3 \1 \4

Followed by some manual review to make sure I'm not changing too much,
omitting some changes that looked too complicated and anything that
caused test failures, and some whitespace fixes.

Change-Id: I6ec7587607df4f1a4f448a096c3e44c4e5270b70
2023-08-29 01:04:26 +00:00
Bartosz Dziewoński
c03cb71796 Use real type hints for services etc. in api/ApiQuery*.php
Mostly used find-and-replace:

Find:
/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?)[\s\*]+/\s*(private|protected|public) (\$[a-z]\w+;\n)((?=\s*/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?))\n|)
Replace with:
\3 \1 \4

Followed by some manual review to make sure I'm not changing too much,
omitting some changes that looked too complicated and anything that
caused test failures, and some whitespace fixes.

Change-Id: Ie78be1c614985d7c2964156e454cc9266515dc18
2023-08-29 01:02:40 +00:00
Bartosz Dziewoński
14e598f850 ApiWatchlistTrait: Use real type hints, remove duplicate definitions
Change-Id: Ib1407641222935a370f3e8e492558faa9f3f2bdf
2023-08-29 00:59:07 +00:00
Bartosz Dziewoński
685df36762 SearchApi: Use real type hints, remove duplicate definitions
Change-Id: I669839a3e10acc8210e4c068366edd2fcd547806
2023-08-29 00:58:41 +00:00