(bug 25339) Allow specifying separate base paths for local and remote paths in Resour...
authorRoan Kattouw <catrope@users.mediawiki.org>
Wed, 27 Oct 2010 22:22:10 +0000 (22:22 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Wed, 27 Oct 2010 22:22:10 +0000 (22:22 +0000)
commit6d4d8641f6d93b54b5e68b840512ebcc1ad24d03
tree32ebfe3c3557f28412a89fd927ec0fa95b965b81
parent2bc8d0bfde28717f38de1fb339933e8fccbad6fc
(bug 25339) Allow specifying separate base paths for local and remote paths in ResourceLoaderFileModule::__construct(). Extensions can use this to properly point the resource loader to their resources in a way that doesn't depend on the extensions/ directory being a subdirectory of phase3/ on the filesystem and that respects $wgExtensionAssetsPath. Also converted all extensions using ResourceLoader to use this approach, except MWEmbed which uses way more indirection building its module registrations than I can deal with after midnight.

What actually happens here
* Add $localBasePath, $remoteBasePath params to the FileModule constructor, defaulting to $IP and $wgScriptPath respectively
* Add getLocalPath() and getRemotePath(), which use this information to build a proper FS or URL path for a file
* Make readScriptFiles() non-static so it can use these functions
* Run every single file path we use through either getLocalPath() or getRemotePath() as appropriate
** Except file dependencies, these are already prefixed. Our inability to give them special treatment caused bugs earlier
* Kill prefixFilePathList() and resolveFilePath(), no longer needed
includes/resourceloader/ResourceLoaderFileModule.php