The Rdbms library already takes care of caching and re-using connections
nowdays. Perhaps in a past where DBConnRef was less common or not
yet created this made sense, but we've now adopted that universally.
I don't know of a current use case for WMF, given the removal of
non-vertical query groups in T263127 (e.g. we keep "api" for all API
traffic, but not e.g. something individual classes would change).
For now I've documented that in someone does run into this, perhaps
in third-party code, that we recommend instead to override getDB()
instead of relying on this central mechanism. E.g. overriddet getDB()
to return `wfGetDB(DB_REPLICA,'mygroup')`.
Bug: T263127
Change-Id: I4c3cc7868f1f4210ee655541eb6a45705c643c70
Even the service does not long stay in that classes,
it should be injected to avoid global state
Bug: T304780
Change-Id: Ib488037f5a6966ab61042ed3cd889ddc50f1ba8e
Getting only the gender option from the UserOptionsLookup is expensive,
because each option results in one query to load all options.
The GenderCache allows for prefilling the gender for multiple
users and results in only one query. That can make a difference if
multiple user names are requested.
Change-Id: Id954a636452d5729eb3b8050db4a0068bf02c9ed
This covers all occurrences of /onfig->.*get( '/ in includes/.
Undoubtedly there are still plenty more to go.
Change-Id: I33196c4153437778496f40436bcde399638ac361
The parameter is using the UserDef validation,
which provides all this features
Also all params are guarded to be set in the $params array after
extractRequestParams(), no need to use isset on $params.
Make explicit that empty bkusers= or bkids= are ignored,
instead using the implicit check in addWhereFld.
Doing nothing when requesting nothing would be a breaking change.
Change-Id: I3602412874b1b3a954037d95ad7cefbe865e3893
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
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
This patch injects services into WikiExporter. It also adds a
WikiExporterFactory service for creating WikiExporter instances.
Change-Id: Ib1547defea54c309865c116bc83d617c21568843
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
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
Remove the @internal getter for the global and
use MediaWikiServices directly at one remaining place.
Change-Id: I120f9c00d22d6dcf2a996eec5b9d5e5d41b68284
All classes extending ApiQueryRevisionsBase, for searching:
ApiQueryAllRevisions, ApiQueryAllDeletedRevisions
ApiQueryRevisions, ApiQueryDeletedRevisions
Including services for the ApiQueryRevisionsBase class
Bug: T259960
Change-Id: I001a9d39355becacab2e34a00027d04ddf7602b5
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