| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader itself.
Move the tests by analogy.
I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".
I did not address DependencyStore which continues to have a non-standard
location and namespace.
Revert of a241d83e0a6dabedf.
Bug: T308718
Change-Id: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit e08ea8ccb9932f9924a613056afcb2d01c8c7b39.
Reason for revert: Breaks Phan in extensions, and as far as I’m aware,
this change isn’t urgently needed for anything, so the simplest fix is
to revert it again for now. After PHP 7.4 it should be safer to try this
again (we hopefully won’t need the two “hack” classes by then).
Bug: T308443
Change-Id: Iff3318cbf97a67f821f78e60da62a583f63e389e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader and
ResourceLoaderContext.
Move the tests by analogy.
I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".
I did not address DependencyStore which continues to have a non-standard
location and namespace.
Change-Id: I92998ae6a82e0b935c13e02a183e7c324fa410a3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
The following sniffs now pass and were enabled:
* Generic.ControlStructures.InlineControlStructure
* MediaWiki.PHPUnit.AssertCount.NotUsed
npm:
* svgo: 2.3.0 → 2.3.1
* https://npmjs.com/advisories/1754 (CVE-2021-33587)
Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The message cache is originally meant for mw.messages in JS,
which expects non-existent messages to be cleanly omitted.
There is minimal server-side and client-side handling in place for this.
For LESS, however, we were assuming that the blob is complete,
thus not feeding anything to the LESS compiler, thus leading to
a run-time failure where the LESS file can't be parsed at all
due to an undeclared variable.
This could happen sometimes during development or after upgrading
a wiki with a stale LocalisationCache that is still being updated
at that time.
Bug: T267785
Change-Id: I60ff4eb7dce1fee56470acc177afd29ee14b764f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a void return hint to methods that are not meant to return
anything. This helps catch accidental return statements in the
future, lets Phan better understand how methods are meant to be
used, and might also allow PHP to better optimise the compiled
code form (speculation).
I did not, however, add it to publicly extended methods as that
might mess with strict mode.
* Remove the internal getResourceLoader() method from MessageBlobStore.
This has been redundant since 3edaa0b37c1e2684.
The method was protected, and not considered stable to subclass
for extensions. Hence not a breaking change.
* Add Throwable typehint to formatException() and friends.
This is the narrowest one I could add given that the methods
called from here already enforce the same typehint.
Update the doc to match for now. There isn't a reason right now
to limit this only to Exception, and given this is the method
and not the catch statement itself, does not change behaviour.
* Remove unused ResourceLoader->getHookContainer().
Added within 1.35 cycle, safe to remove.
* Remove unexpected `@since` for `@internal` getHookRunner().
* Remove redundant `@internal` from ResourceLoaderMwUrlModule
methods, which itself is already `@internal`.
Change-Id: I68d33ff6feca7ef95282a7ff03eb9332adfde31c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Where possible and easy to figure out, change `array` to something like
`array<K,V>` or `V[]` for improved static analysis to catch/prevent
regressions in CI.
* Minor doc improvements:
- consistently use the imperative mood for method briefs,
- consistently use @internal instead of @private,
- explain in @throws why they happen to inform when they should be caught
(and remove if they are not meant to be caught/handled by any caller).
* Simplify addSources() implementation as a simple loop instead recursing
(not worth the complexity, only called once or twice at runtime).
* Use more granular exceptions to distinguish between errors that indicate
a mistake on the caller (logic/invalid arguments error), and runtime
errors (which are more circumstantial).
* Update register() unit test for bad 'moduleInfo' type to use
a nested value, given that the second-parameter level type is
now verified by the signature already.
Change-Id: Id98ba1f28cb7f1c72f0a3e82f4151bcbd0f3db77
|
|
|
|
| |
Change-Id: I0f4c4e0e753574cf060331c944f44318eaca1fec
|
|
|
|
|
|
|
|
|
|
|
|
| |
When clearing the LocalisationCache, avoid instantiating a ResourceLoader
instance. Doing so introduces a circular dependency among service
instances.
This patch introduces a static method for clearing the MessageBlobStore
without the need for a ResoruceLoader instance.
Bug: T231866
Change-Id: I404e64713fee6a534ba014981cef78af0b91f2aa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add license header where missing.
* Add missing `@since` (1.17 for most classes), except
ResourceLoaderLessVarFileModule since 1.32 (1bc62c548c).
* Remove duplicate file-level description for class-only files,
merge with the class description instead.
* Remove my own `@author` annotation from one file.
* Mark core's own FileModule subclasses as `@internal`, except
for the following which we support use of in extensions:
ResourceLoaderLessVarFileModule,
ResourceLoaderOOUIIconPackModule, and
ResourceLoaderWikiModule.
Change-Id: I336af2e4ccdbe2512594e8861b72628d24194e41
|
|
|
|
|
|
|
|
|
|
|
| |
It's not needed to escape UTF-8 characters in messages.
The characters '&', '<' and '>' are still escaped. For the output in
load.php this escaping is not necessary but messages can also embedded
into <script> tags and here are the characters '<' and '>' problematic.
Bug: T229301
Change-Id: If424a21df4a813ba6cb79b939f0857d96f162a17
|
|
|
|
|
|
| |
constants
Change-Id: I95771fc8d032939e71adba3a416894004ea0847d
|
|
|
|
|
|
|
| |
Also remove a few redundant file-level descriptions in favour
of their class entity describing the same already.
Change-Id: I1a43fc402b5bd106931062a399952ba1e48beb48
|
|
|
|
|
|
|
|
|
|
| |
Because it was still per-wiki, which isn't useful and makes
it really slow to invalidate by requiring a 900-wiki iteration
during deployments all of which fully initialise MW just to
send a single Memcached command basically.
Bug: T222539
Change-Id: I02a3e7d83172ccd7d8d0fba3be1e3f1ebb77efb2
|
|
|
|
|
|
|
|
|
|
| |
Previously, it was exporting the result of $msg->plain() regardless
of $msg->exists(). This meant that, client-side, via mw.message
the message would always make mw.Message#exists return true, even
if in fact it did not exist.
Bug: T221294
Change-Id: I77122777ddaaa2d43f8385df9292540a8d21b328
|
|
|
|
|
|
|
|
|
|
|
| |
This class is basically `@internal`, but not yet marked as such.
The only non-core use case is a WikimediaMaintenance script,
so I suppose we can keep it public.
It's purpose is for batching, the single blob method is not
used anywhere in Wikimedia Git.
Change-Id: If2a0497b1412efbfd55b34b512d2b9e5346359fb
|
|
Move source code to includes/resourceloader to match
test case. This is part of ResourceLoader and not meant
to be used elsewhere.
Merge two similar test cases for getting blobs and fetching
messages which were doing the same thing.
Rewrite the test names to be a better reflection of the stories
they test, add comments for why, and re-order them to put related
tests together.
Move test-utilities to the bottom and make them actually private.
Change-Id: I7a437eebf3ba6a722e286dfe77c2f9fe49ad222f
|