wiki.techinc.nl/tests/phpunit/includes/resourceloader
Timo Tijhof 047b60b96d resourceloader: Store relative instead of absolute paths in module_deps
Make paths stored in the module_deps table relative to $IP. This ensures that when
the MediaWiki install path changes and/or if the location of the extension or skins
directory changes, that ResourceLoader's internal model is still accurate.

Previously when these paths change, ResourceLoader would exhibit various bugs.

1. Unable to detect changes in the module (if the directory no longer exists).
2. Point #1 is usually preceeded by one last cache invalidation as the content hash
   of the file path changes (from a valid hash to an empty string).
3. Unnecessary cache invalidation (if both old and new directories exist). This
   happens when a file is both an entry point (in the 'scripts' or 'styles' array)
   and also a file dependency. At first they are de-duplicated by array_unique.
   But after the disk path changes, the next check will result in the old path
   being fetched from module_deps, and the new path from the live configuration.
   This causes two changes that result in needless cache invalidation:
   - The hash list contains one more item (T111481).
   - The hash list contains both the old and new version of a file.
     (or even alternate versions, e.g. when a change is backported to the old
     wmf branch; it also affects wikis on the new branch due to the stale
     file path still in the database).

It seems unusual to move a MediaWiki install, and usually we recommend third
parties to run update.php if site administrators do move their wiki. However
Wikimedia's deployment system implicitly moves the MediaWiki install continously
from e.g. "/srv/mediawiki/php-1.26wmf5" to "/srv/mediawiki/php-1.26wmf6".

This caused virtually all ResourceLoader caching layers to get invalidated every
week when another wmf-branch is deployed, thus breaking these file paths, which
changes the version hash, which then invalidates the cache.

Bug: T111481
Change-Id: I173a9820b3067c4a6598a4c8d77e239797d2659c
2015-09-30 00:25:27 +00:00
..
templates resourceloader: Add support for delivering templates 2014-10-29 19:31:16 +00:00
DerivativeResourceLoaderContextTest.php resourceloader: Fix broken getRequest/getDirection in derived context 2015-06-13 06:00:33 +01:00
ResourceLoaderFileModuleTest.php Fix whitespace issues around parentheses 2015-06-16 22:14:02 +03:00
ResourceLoaderImageModuleTest.php Wrap some long strings in tests/ 2015-09-26 21:01:59 +01:00
ResourceLoaderImageTest.php Wrap some long strings in tests/ 2015-09-26 21:01:59 +01:00
ResourceLoaderModuleTest.php resourceloader: Store relative instead of absolute paths in module_deps 2015-09-30 00:25:27 +00:00
ResourceLoaderStartUpModuleTest.php resourceloader: Move startup code from PHP to startup.js 2015-07-27 16:41:16 -07:00
ResourceLoaderTest.php resourceloader: Fully remove ResourceLoaderLESSFunctions 2015-09-04 01:41:40 +00:00
ResourceLoaderWikiModuleTest.php Wrap some long strings in tests/ 2015-09-26 21:01:59 +01:00