wiki.techinc.nl/tests/phpunit/unit/includes/ResourceLoader
Bartosz Dziewoński 566b185e9c resourceloader: Tweak RL\FilePath handling in packageFiles
ResourceLoader's FilePath is designed to allow a FileModule
to include files that exist outside of the module's localBasePath,
to allow skins and extensions to extend core MediaWiki modules.
This is accomplished by having the FileModule use the FilePath's
localBasePath instead, in FileModule::getLocalPath.
(Similarly for remoteBasePath, but these are going out of fashion.)

However, the code processing 'packageFiles' did not handle this right:
it used FilePath's localBasePath when it appeared as a 'file',
but not when it was returned by a 'callback' or 'versionCallback',
using the FileModule's localBasePath instead in that case. Most
existing uses of FilePath in 'packageFiles' required the same base
path as the module, so it was convenient to avoid providing it twice.

To keep that convenience (already relied on by some extensions too)
while also allowing skins and extensions to add files from their own
directories to existing modules, the code processing 'packageFiles'
now uses FilePath's base paths in all cases, but they are optional,
and will fall back to the FileModule's paths when not provided.

Follow-up to 2890bca27d.

Change-Id: I38a0761ae4633a567b685b52c1d73b6ce280ffb7
2022-05-27 22:40:41 +01:00
..
FilePathTest.php resourceloader: Tweak RL\FilePath handling in packageFiles 2022-05-27 22:40:41 +01:00
ImageTest.php ResourceLoader namespace (attempt 2) 2022-05-24 15:41:46 +00:00
VueComponentParserTest.php ResourceLoader namespace (attempt 2) 2022-05-24 15:41:46 +00:00