Application logic should use the BaseDirectory config variable.
Framework code should use MW_INSTALL_PATH to locate files should.
NOTE: Update https://www.mediawiki.org/wiki/Manual:$IP
Bug: T300301
Depends-On: I7142af16d692f26e90673b058029f572c1ea3991
Change-Id: Ib4caa80bb7007c4c7960a2fd370cf5da7d9ba344
This avoids mismatches between the language in the message cache and the
language converter used for content language.
Bug: T292239
Change-Id: I1f0ca70b184362a783d164658b3867e00a306591
* Skin constructor docs were unreadable on doc.wm.o and in other
places and IDEs that display docs due to lack of formatting (line
are just whitespace in Markdown, same as HTML).
* Make some of the method briefs (first line separated by new line)
more useful, especially where this brief was missing and thus
rendered unhelpful text like "Returns array of:" with no more.
* Misc grammar and typo fixes, consistent phrasing, and other minor
points from code conventions. Changed a few "fetch" to "get" in
trivial methods.
* Found a bug in SkinFactory::register() regarding skipskin handling,
will fix in follow-up.
* Found a bug in Skin::buildSidebar() regarding insufficient cache
fragmentation. Will fix in a follow-up.
Change-Id: I3609cc71de48d3f5c8404ea834d42c0cec5cba59
Use the object factory to inject service into TrivialLanguageConverter
class.
The other language converter classes does not use service directly.
The classes are using indirectly services in some function of
the parent class, which needs injection as well (tracked with T294185).
Needs fallback to global state in TrivialLanguageConverter, because the
class is used in extensions integration tests
Change-Id: If72d054d062a4f357e12c5b168e118bfafffd626
Without the default the preference is never deleted from the database,
even it was disabled by the user.
This can be tested by check "all" on Special:Search and save it for
future searches. After checking "none" and selecting the main namespace
and save it for future searches there still the other searchNS options
on the database.
Bug: T291748
Change-Id: Idb3a8774b82f5f27fbeda4537dfdacf59768e8c0
* In LinkBatch::addObj(), reject interwiki links with a warning.
Otherwise the link is added to the batch by ns/title and later
reconstructed as if it were a local link without an interwiki
prefix.
* In CommentParser, treat interwiki links as always good, don't defer
the existence check.
* In LinkBatch, inject a LoggerInstance instead of calling LoggerFactory
in four places.
* Add a regression test, and some general tests for known links.
Bug: T300311
Change-Id: I0e5825eb48a6ba2932aea69a4d0fff3439c50ff5
The BlockRestrictionStoreFactory is a new service which allows fetching
of a wiki-specific BlockRestrictionStore by fetching the correct
LoadBalancer via a LBFactory and then injecting it into the
BlockRestrictionStore.
This is being done as a part of the project of supporting cross-wiki
blocking. Currently if a cross-wiki block with restrictions is being
created, the block is being stored in the foreign database, but the
restrictions are being stored in the local one.
Blocks were made wikiaware in I8ae8133f7e232cc75aae6b72fcd7feaeb313cba7.
Bug: T291983
Change-Id: Ia342030c31710f40c95acc75d3cc76f1ad79d806
- Make order of the config consistent.
- Change the default config for format to 'null'.
Bug: T240685
Change-Id: Id022e62e881bdc7c4896ba070ed2b0ad47b25c74
Currently this is implemented internally as a second method call. In the
future, it might be possible to optimize the implementation, e.g. to
reduce the amount of DB queries/jobs etc. without changing anything for
callers.
Since the implementation of e.g. the result getters is generic, a future
commit may add an option to delete subpages with relatively low effort.
The revision limit for big deletions is now using the total number of
revisions (base page + talk page). This is because both deletions would
happen in the same main transaction, and we presumably want to optimize
the deletion as a whole, not as two separated steps. This would become
even more important if the aforementioned improvements are ever
implemented. Note, the whole concept of "big deletion" might have been
superseded by batched deletions in the author's opinion, but as long as
such a limit exists, it should serve its purpose.
The current interpretation of the associated talk option is that the
request is validated, and an exception is raised if we cannot delete the
associated talk, as opposed to silently ignoring the parameter if the
talk cannot be deleted. The only exception to this is that it will not
fail hard if the talk page turns out not to exist by the time the
deletion is attempted, as that's hard to foresee due to race conditions.
Note that the summary for the talk deletion is prefixed with the
delete-talk-summary-prefix message. The main reason behind this is that
the delete UI can sometimes offer an auto-generated summary like "the
only contributor was XXX" or "the content was YYY", and since this may
not apply to the talk page as well, the log entry might look confusing.
Bug: T263209
Bug: T27471
Change-Id: Ife1f4e8258a69528dd1ce8fef8ae809761aa6f1d
This is for page-recent-delete and db-replicated should not be used for
this. Simply use the standard and common service providing the same
functionality.
Bug: T272512
Change-Id: Iabaffd726370f5a580097819fd854da82bf43907
PreparedUpdate represents an in-progress edit. It can be used to access
information about the edit from hooks that do to have access to the
PageUpdater. Ideally, the PreparedUpdate or PageUpdater would be passed
to the hook as a parameter. Handlers of legacy hooks may use
WikiPage::prepareUpdate() to access it.
Bug: T242249
Needed-By: I23324a31e06e7e6f28077085c0ade05db63e9a35
Change-Id: Id5ba40a21cc4547205adf2f3a1f725c3a69c24d8
These special pages and their counter-part APIs are:
- Special:RecentChanges
- Special:Watchlist
- Special:Log
- Special:Contributions
This also changes the way MAX_EXECUTION_TIME works from taking the value
as milliseconds, it takes seconds which is more intuitive for users.
Bug: T297708
Depends-On: I126e7181422d8da1a63afc3717faa4f72a687dd9
Change-Id: I3ff78751c3df3b6342f1865d35c2075f4415185d
The concept of a redirect chain didn't really work for a value of
max redirect > 1. In the ideal world, we just want to have a source
which points to target (source -> target) discarding the concept of
a redirect chain completely.
Having something like: source -> target -> target1 -> target2 doesn't
really work well with the current database design.
NOTE: Support for $wgMaxRedirect will be removed soon hence
deprecation without interfaces for replacement.
Bug: T290639
Change-Id: I469de6f85e405e8ddbe7abaa5b99b77cb9cf415d
This marks whether links are being rendered for comments or elsewhere.
This information can be used in hooks; specifically, Wikibase wants to
add labels to entity links only in comments and on special pages.
Bug: T292203
Change-Id: I9164f760e8b46e05218fb36f430bc36ef1fdf30f
NamespaceInfo was added in
I4af843238ffd58925f57c0f7b98253a90cb285ec
and removed in:
I5c9ea04a9deca136bb7210f07200d18f97fd6686
Change-Id: I64612b57b0e5e5c7c126d7434e5b108fc735ac57
This reverts commit 98878c08ba.
reason for revert: had some weird and unwanted side effects
Bug: T294265
Change-Id: I53c2175498af5b37096505dae011e65cebf029aa
This moves the implementation of ParserOutput::addTrackingCategory()
to the TrackingCategories class as a non-static method. This makes
invocation from ParserOutput awkward, but when invoking as
Parser::addTrackingCategory() all the necessary services are
available. As a result, we've also soft-deprecated
ParserOutput::addTrackingCategory(); new users should use the
TrackingCategories::addTrackingCategory() method, or else
Parser::addTrackingCategory() if the parser object is available.
The Parser class is already kind of bloated as it is (alas), but there
aren't too many callsites which invoke
ParserOutput::addTrackingCategory() and don't have the corresponding
Parser object handy; see:
https://codesearch.wmcloud.org/search/?q=%5BOo%5Dutput%28%5C%28%5C%29%29%3F-%3EaddTrackingCategory%5C%28&i=nope&files=&excludeFiles=&repos=
Change-Id: I697ce188a912e445a6a748121575548e79aabac6
Dependency injection and cleanup. Rename ::isDeleted
to more clear ::hasArchivedRevisions.
Bug: T290022
Change-Id: Ifff6076f79ee2ad08e4635fba8fd141e4de93b01
WikiPage::doEditUpdates() has been deprecated. Using the PageUpdaterFactory's
newDerivedPageDataUpdater() is the new way forward. Also, I made sure to have
the `$options` array with the `causeAction` and `causeAgent` key/value pairs.
Change-Id: I9f2c212d7c83a46799f9f947dc372dc364289680
The existing method of hardcoding ApiOutput and Fallback is not
great, and there is a use case inside Vector as we split
Vector skin into two as well as inside ContentTranslation.
This adds to the existing wgSkipSkins configuration by allowing
skins to register themselves as skippable without a LocalSettings
change.
Bug: T291193
Change-Id: I9caa8deb5b58fa1ef1eb548db497ef095cbbd154
Add entry in MediaWikiServices, add wiring code, inject all dependencies.
Also add an alternative entry point with permission checks, like for
DeletePage.
The new service is no longer @unstable, and the relevant methods in
PageArchive were deprecated.
Bug: T290021
Change-Id: I452a98679f5bfea3f7367aacd5c930acffd32102
Update/Create override classes of ContentHandler.
Soft-deprecate and remove method from Content and classes that override them.
Bug: T287158
Change-Id: Idfcfbfe1a196cd69a04ca357281d08bb3d097ce2
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
Prior to this change UserOptionsManager::saveOptions was
@internal, since it was not updating user_touched or calling
the UserSaveSettings hook, which some extensions might
have been expecting. This method however was already used
to save the user options.
This patch makes the UserOptionsManager::saveOptions
feature complete and removes the @internal tag.
Bug: T284354
Change-Id: Iadb723b78da04d02dad9abfbfcf13fa25a43a115