aboutsummaryrefslogtreecommitdiffstats
path: root/includes/ResourceLoader/LanguageDataModule.php
Commit message (Collapse)AuthorAgeFilesLines
* ResourceLoader: Allow FileModule scripts to be generated with a callbackTim Starling2023-05-091-86/+0
| | | | | | | | | | | | | | | | | | | | | | | To implement source maps, we want FileModule::getScript() to return an array with path information, but that would break subclasses of FileModule which concatenate to the return value of parent::getScript(). So allow scripts to be generated by a callback, eliminating the need for concatenation in subclasses. * Factor out most of the loop body of expandPackageFiles() into expandFileInfo(). Add 'name' to the return value. Ensure 'filePath' is always a FilePath object since we need that to safely return it to ResourceLoader later. Document the return value. * Make sure the base path is always set in FilePath objects returned by expandFileInfo(). * Factor out the loop body of the final stage of file info expansion into readFileInfo(). Retain filePath, do not unset it. * Assert that $fileInfo['content'] is definitely set. * Convert array_map() in getDefinitionSummary() to a loop. * Migrate LanguageDataModule. Bug: T47514 Change-Id: I97d61b5793159cea365740e0563f7b733e0f16de
* ResourceLoader: Define targets in a single locationKosta Harlan2023-02-021-1/+0
| | | | | | | | | All the *Module classes end up inheriting from ResourceLoader/Module, so we only need to define the targets there. Bug: T127268 Bug: T328497 Change-Id: I12b126377cea78b88269e6efe68f92f3586c4ecc
* ResourceLoader namespace (attempt 2)Tim Starling2022-05-241-0/+87
| | | | | | | | | | | | | | | | | | 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
* Revert "ResourceLoader namespace"Lucas Werkmeister (WMDE)2022-05-161-87/+0
| | | | | | | | | | | | 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
* ResourceLoader namespaceTim Starling2022-05-161-0/+87
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