Commit graph

352 commits

Author SHA1 Message Date
jenkins-bot
24373dab6b Merge "Replace Content::getParserOutput call to ContentRenderer::getParserOutput" 2021-10-20 17:56:19 +00:00
Roman Stolar
fa5237eb48 Replace Content::getParserOutput call to ContentRenderer::getParserOutput
Bug: T287158
Change-Id: I8a13f45027e08e2d8ddefa140dd47a0c55094934
2021-10-20 12:11:24 +03:00
jenkins-bot
3c697fd5ee Merge "api: Inject services into ApiQuery class" 2021-10-19 20:16:07 +00:00
jenkins-bot
e7f4484611 Merge "Make first char of username in ApiQueryAllUsers case-insensitive" 2021-10-05 20:57:54 +00:00
Tim Starling
f7f84dddb3 Introduce CommentFormatter
CommentParser:

* Move comment formatting backend from Linker to a CommentParser service.
  Allow link existence and file existence to be batched.
* Rename $local to $samePage since I think that is clearer.
* Rename $title to $selfLinkTarget since it was unclear what the title
  was used for.
* Rename the "autocomment" concept to "section link" in public
  interfaces, although the old term remains in CSS classes.
* Keep unsafe HTML pass-through in separate "unsafe" methods, for easier
  static analysis and code review.

CommentFormatter:

* Add CommentFormatter and RowCommentFormatter services as a usable
  frontend for comment batches, and to replace the Linker static methods.
* Provide fluent and parametric interfaces.

Linker:

* Remove Linker::makeCommentLink() without deprecation -- nothing calls
  it and it is obviously an internal helper.
* Soft-deprecate Linker methods formatComment(), formatLinksInComment(),
  commentBlock() and revComment().

Caller migration:

* CommentFormatter single: Linker, RollbackAction, ApiComparePages,
  ApiParse
* CommentFormatter parametric batch: ImageHistoryPseudoPager
* CommentFormatter fluent batch: ApiQueryFilearchive
* RowCommentFormatter sequential: History feed, BlocklistPager,
  ProtectedPagesPager, ApiQueryProtectedTitles
* RowCommentFormatter with index: ChangesFeed, ChangesList,
  ApiQueryDeletedrevs, ApiQueryLogEvents, ApiQueryRecentChanges
* RevisionCommentBatch: HistoryPager, ContribsPager

Bug: T285917
Change-Id: Ia3fd50a4a13138ba5003d884962da24746d562d0
2021-09-28 11:13:03 -07:00
Fomafix
213d45e5dd Make first char of username in ApiQueryAllUsers case-insensitive
This change uses $contentLanguage->ucfirst( $name ) to get the
canonical username like this is done in UserNameUtils::getCanonical().
This makes the first character case-insensitive. The toUpperCase() in
JavaScript is not needed anymore.

toUpperCase() in JavaScript and $contentLanguage->ucfirst() in PHP
differ on some characters:
* JavaScript: "ß".toUpperCase() // "SS"
* PHP: $contentLanguage->ucfirst( "ß" ) // "ß"

Bug: T291339
Change-Id: Id9afb2dd0212e4b871bb6a7a9d8762e1bcb81d6a
2021-09-21 06:21:21 +00:00
Umherirrender
5e7cd5fdd1 api: Inject services into ApiQuery class
Bug: T259960
Change-Id: I64b0c62f0c51e10c799794d8ad399dd8428f63b5
2021-09-17 00:57:37 +02:00
jenkins-bot
76ba780e41 Merge "WikiExporter: inject services" 2021-09-16 17:04:04 +00:00
Umherirrender
07b499fbcf build: Update mediawiki/mediawiki-phan-config to 0.11.0
Addition and remove of suppression needs to be done with the version
update.

Change-Id: I3288b3cefa744b507eadebb67b8ab08c86517c1c
2021-09-07 17:19:05 +02:00
Alexander Vorwerk
2fbf13812a WikiExporter: inject services
This patch injects services into WikiExporter. It also adds a
WikiExporterFactory service for creating WikiExporter instances.

Change-Id: Ib1547defea54c309865c116bc83d617c21568843
2021-09-06 10:03:37 +00:00
Umherirrender
5b3d3ef802 collation: Create CollationFactory service
Use ObjectFactory specs for collation classes
Avoid the language construction in the factory class,
make it a detail of the implementation of each class

Follow-Up of Ifc96f851e6091ce834dbaf0e91695c648a42169c

Bug: T286079
Change-Id: Ib581f64aec8619986fb8dd49ceee0524d59a1b84
2021-09-04 02:46:06 +02:00
Umherirrender
de676bd359 API: Change object specs for remaining un-serviced API modules
There are no services yet to use on these API modules.
Prepare for easier injection for the future.

Modules are:
- ApiLogout
- ApiRsd
- ApiTokens
- ApiCheckToken
- ApiCSPReport
- ApiEmailUser
- ApiRevisionDelete
- ApiManageTags
- ApiFormatJson
- ApiFormatPhp
- ApiFormatXml
- ApiFormatNone
- ApiQueryCategories
- ApiQueryCategoryInfo
- ApiQueryExternalLinks
- ApiQueryBacklinksprop
- ApiQueryImages
- ApiQueryIWLinks
- ApiQueryAllCategories
- ApiQueryMyStashedFiles
- ApiQueryBacklinks
- ApiQueryCategoryMembers
- ApiQueryExtLinksUsage
- ApiQueryIWBacklinks
- ApiQueryLangBacklinks
- ApiQueryPagesWithProp
- ApiQueryPagePropNames
- ApiQueryRandom
- ApiQueryTags
- ApiQueryTokens

Also normalize use of trailing commas.

Bug: T259960
Change-Id: Ibe8a79abf6fce70713775d07d4f4b5a1338934f6
2021-09-03 23:23:03 +00:00
Roman Stolar
3d1f0d7f7a Replace Content::preSaveTransform call to ContentTransformer::preSaveTransform
Bug: T287156
Change-Id: I5709441318abc210b3d3beb0be6f2bcbe45ddd36
2021-08-19 20:29:28 +03:00
DannyS712
18d732811d ApiQueryInfo: add associatedpage prop
Returns the prefixed title for the associated page,
if it could exist (i.e. does not do anything for special pages)

Bug: T257014
Change-Id: I49cdc138c6182b323c4933e90dc96c5e06b6ccba
2021-07-09 19:48:20 +00:00
Umherirrender
aa39959bc6 api: Inject GroupPermissionsLookup into modules
Remove the @internal getter for the global and
use MediaWikiServices directly at one remaining place.

Change-Id: I120f9c00d22d6dcf2a996eec5b9d5e5d41b68284
2021-07-06 20:48:35 +00:00
Umherirrender
84d1542e67 api: Inject services into ApiQuery(All)(Deleted)Revisions
All classes extending ApiQueryRevisionsBase, for searching:
ApiQueryAllRevisions, ApiQueryAllDeletedRevisions
ApiQueryRevisions, ApiQueryDeletedRevisions

Including services for the ApiQueryRevisionsBase class

Bug: T259960
Change-Id: I001a9d39355becacab2e34a00027d04ddf7602b5
2021-07-05 20:03:06 +02:00
jenkins-bot
caa36dbcb9 Merge "api: Inject services into ApiQueryFileRepoInfo" 2021-07-05 17:13:02 +00:00
jenkins-bot
195fb38405 Merge "api: Inject services into ApiQueryImageInfo/ApiQueryStashImageInfo" 2021-07-04 23:41:42 +00:00
DannyS712
27d9452f6d Inject dependencies into SearchApi
Used in api classes where services can be injected,
no need to rely on MediaWikiServices

Will make it possible to convert ApiOpenSearchTest to
a unit test, since everything is injected, but that will be
done in a follow-up

Plus some minor cleanup to SearchApi

Change-Id: If0a3a60f1ead897947143b57d98a3a506387f6d5
2021-07-04 10:58:36 +00:00
jenkins-bot
b700db02a1 Merge "api: Replace deprecated language variant functions in ApiQueryInfo" 2021-07-03 23:24:24 +00:00
jenkins-bot
81cdb1fd5a Merge "api: Inject services into ApiQueryWatchlistRaw/ApiQueryWatchlist" 2021-07-03 23:23:01 +00:00
jenkins-bot
1789a62021 Merge "api: Inject services into ApiQueryAllMessages" 2021-07-03 23:22:54 +00:00
jenkins-bot
3902829693 Merge "api: Inject services into ApiQueryAllImages" 2021-07-03 23:22:48 +00:00
jenkins-bot
d142434445 Merge "api: Inject services into ApiQueryAllPages" 2021-07-03 23:22:41 +00:00
jenkins-bot
34fff16c47 Merge "api: Inject services into ApiQueryRecentChanges" 2021-07-03 23:19:40 +00:00
jenkins-bot
f163b542bc Merge "api: Inject services into ApiQueryUsers" 2021-07-03 23:19:34 +00:00
jenkins-bot
9caf2a1962 Merge "api: Inject services into ApiQueryUserContribs" 2021-07-03 23:16:41 +00:00
jenkins-bot
82eb3e3a01 Merge "api: Inject services into ApiQueryDeletedrevs" 2021-07-03 23:16:36 +00:00
jenkins-bot
47bcec99d9 Merge "api: Inject services into ApiQuerySiteinfo" 2021-07-03 23:16:29 +00:00
Umherirrender
058a49824d api: Inject services into ApiQueryDeletedrevs
Bug: T259960
Change-Id: Ia17a6d8100efc9a63e5ba524e2c5f909c860b947
2021-07-04 00:30:36 +02:00
Umherirrender
39cba91f57 api: Inject services into ApiQueryUserContribs
Bug: T259960
Change-Id: I8b49ad1b79f7764a59bf1aaa1e2416fb0e6d4af3
2021-07-04 00:19:13 +02:00
Umherirrender
4c2d078c2d api: Inject services into ApiQueryUsers
Bug: T259960
Change-Id: I3465ee0de34430bbd4969ef8a83baed959da5da6
2021-07-03 23:57:18 +02:00
Umherirrender
d51caa7884 api: Replace deprecated language variant functions in ApiQueryInfo
Change-Id: Ibdfc52031808154a7b8e179f70a576224ee97458
2021-07-03 21:36:14 +00:00
Umherirrender
4e8b88d680 api: Inject services into ApiQuerySiteinfo
Bug: T259960
Change-Id: I572d73d154c5858ae0e66661d97de56db12d649d
2021-07-03 21:06:29 +00:00
Umherirrender
96ce9545ad api: Inject services into ApiQueryAllUsers
Bug: T259960
Change-Id: I81d5b8fb5454edd964d016fbddf0a83ad3c3df5f
2021-07-03 22:48:58 +02:00
Umherirrender
555f50e13d api: Inject services into ApiQueryWatchlistRaw/ApiQueryWatchlist
Bug: T259960
Change-Id: I0c93fe4436be1d1703107bb049771ec6e0dc1b23
2021-07-03 21:59:08 +02:00
Umherirrender
616e96fa07 api: Inject services into ApiQueryAllMessages
Bug: T259960
Change-Id: Ib7058c8c55ce65802b501a5a7b7458c14ba27cfe
2021-07-03 21:45:14 +02:00
Umherirrender
1810658dc1 api: Inject services into ApiQueryRecentChanges
Bug: T259960
Change-Id: Ifab55daae08ee49e07bef93656cb7eb474f46cae
2021-07-03 20:50:09 +02:00
Umherirrender
db02ef041a api: Inject services into ApiQueryAllPages
Bug: T259960
Change-Id: I29cea9b16b757618347c85812db5ed14a535f469
2021-07-03 20:21:27 +02:00
Umherirrender
f7ccf077ec api: Inject services into ApiQueryAllImages
Bug: T259960
Change-Id: I6d5e1cdc2c07a9c6c7e8bb1d521209f4a1f2ff14
2021-07-03 18:14:06 +00:00
jenkins-bot
d96071ad13 Merge "api: Inject services into ApiQueryAllLinks" 2021-07-03 03:14:09 +00:00
jenkins-bot
85406f90b0 Merge "api: Inject ChangeTagDefStore into ApiQueryLogEvents" 2021-07-03 03:13:24 +00:00
Umherirrender
a6b2d05e14 api: Inject services into ApiQueryQueryPage
Bug: T259960
Change-Id: Ia1e37fd3c55be36fd9f4d51344165579b77788f9
2021-07-02 23:11:30 +02:00
Umherirrender
e9b02c3d2b api: Inject ChangeTagDefStore into ApiQueryLogEvents
Bug: T259960
Change-Id: I844306512c307e0e1d01f1de2ac1625daa8ed57d
2021-07-02 22:58:00 +02:00
Umherirrender
3135fe4287 api: Inject services into ApiQueryAllLinks
Bug: T259960
Change-Id: I69702c6d0b4318af76f4c4d5d011a6726aeaf35e
2021-07-02 22:47:45 +02:00
Umherirrender
11286edd1a api: Inject services into ApiQueryAuthManagerInfo
Bug: T259960
Change-Id: I2004426a52baf14ae11df94752cb3a69ceaad6f0
2021-07-02 22:02:36 +02:00
Umherirrender
db3b233e8d api: Inject services into ApiQueryFileRepoInfo
Removed self::getInitialisedRepoGroup
RepoGroup class itself should be aware of initalise and
does it in RepoGroup::forEachForeignRepo

Bug: T259960
Change-Id: I5163d02bf345b7922ac4ec8b755c7cf8425a9c37
2021-07-02 21:55:55 +02:00
jenkins-bot
f547c0af2b Merge "api: Inject services into ApiQueryContributors" 2021-07-02 18:55:49 +00:00
Umherirrender
f98cd19728 api: Inject services into ApiQueryImageInfo/ApiQueryStashImageInfo
Bug: T259960
Change-Id: I57b075124a528ab3d64773f58a0a53f3c2a5f0ad
2021-07-02 20:41:27 +02:00
Umherirrender
cbbca8a3c7 api: Inject services into ApiQueryContributors
Bug: T259960
Change-Id: I6354dd2cce05ed422518e5f5e0c8dab0c7fed9b9
2021-07-02 20:10:30 +02:00