Commit graph

7 commits

Author SHA1 Message Date
Lucas Werkmeister
da301247f9 Revert "MessageCache: Avoid 'contributions' replicas"
The 'contributions' group no longer exists, no need to avoid it.

This reverts commit 6efee6f0db.

Bug: T314493
Change-Id: I548077fa3122e9bd5b6cbec990a3dcabffe1659e
2022-08-03 17:14:09 +02:00
Timo Tijhof
e506500bf0 language: Improve type hints in MessageCache.php
* Replace is_/throw with native where possible.
* Prefer strict comparisons where possible.
* Remove `@throws` for exceptions that are not meant to be checked
  or caught by callers.
* Make the separateCacheableRows() return hint more precise.

Change-Id: I1c14bb8faaf1b377b6d179d96e18331acff23c5b
2022-07-15 05:37:51 +00:00
Tim Starling
99e2fae1df MessageCache: Don't load the content for uncacheable rows
Attempting to load the content for 30,000 revisions on metawiki
routinely times out after 60 seconds. So split the result array
from the revision query and treat cacheable revisions differently
to uncacheable ones.

Bug: T313004
Change-Id: I26185f256cbc0a1f664efe65c73131b92a3084dc
2022-07-15 10:51:34 +10:00
Tim Starling
4c0494e95c MessageCache style updates
* Inject config
* Use a consistent single-line comment style
* Don't prefix properties with "m"
* Use "private" instead of "protected". No matches in codesearch for
  /(new|extends) MessageCache/.

Change-Id: Id0cad8a8fa73fb972c13b5386c31658f534e2584
2022-07-15 00:03:58 +00:00
Tim Starling
ad6a1a191d language: Disable MessageCache if load() throws an exception
Bug: T313004
Change-Id: I5e74e371090c2ce7578d540c5a1a85111bd3c70f
2022-07-15 00:01:52 +00:00
Timo Tijhof
0ffe341629 language: Add missing @ingroup, subgroup "Languages" and ungroup files
== Ungroup file blocks

Remove `@ingroup` from `@file` blocks and keep only the class block.

This matches similar changes previously applied to API, Skins, Profile,
and ResourceLoader.

This helps make the API documentation easier to navigate.
E.g. Modules -> Language in the sidebar of
<https://doc.wikimedia.org/mediawiki-core/master/php/> as well as
<https://doc.wikimedia.org/mediawiki-core/master/php/group__Language.html>

These are currently cluttered with tons of duplicate entries for files
and classes both. We only need to group files that aren't also
documented as a class (e.g. message files, entry points, other scripts
or files that we mainly consider a data file). This has the helpful
side-effect that we don't encourage duplication of the class
description (or worse, place useful docs only in the file block), and
makes the class files consistently start with a mentally ignorable
block. Basically, unless there's something other than a class, don't
describe or group the file itself.

== Missing group

Various classes in this subtree were missing the `Language` group,
or were using different group from before T225756.

== Subgroup

For ease of navigation, move Converter subclasses to a group called
"Languages", which for documentation purposes is a subgroup of
"Language". The next commit does the same for Messages* files,
and Language subclasses (done separately for ease of review).

Change-Id: I301f471f86ba2dee924fece29a16dc3c20b5bebe
2022-06-28 17:12:46 -07:00
Timo Tijhof
051e127bdb language: Move l10n-related classes from /cache to /language
* Make the code easier to own and maintain by being part of a topical
  area of expertise rather than a generic catch-all bucket.
  This also helps Gerrit team dashboards, [[mw:Git/Reviewers]]
  subscription patterns, more meaningful component prefix for
  [[mw:Commit_message_guidelines]].

* Prep for possible CODEOWNERS adoption.

* Prep for T166010 to give us better PSR-4 namespaces that we won't
  have to break/migrate again shortly after for the above.

Bug: T225756
Change-Id: I62c701d574d2a79365b1c5350f92bef47770e3ce
2022-06-28 16:27:20 -07:00
Renamed from includes/cache/MessageCache.php (Browse further)