Update ResourceLoader for Ib7fc2f939b

Use BagOStuff::makeKey() and BagOStuff::makeGlobalKey() instead of
wfMemcKey() and wfGlobalCacheKey().

Change-Id: Id4e58c0e616b74de220faf13ba7c9ea606fef8c1
This commit is contained in:
Ori Livneh 2015-10-19 10:00:50 -07:00
parent cb862afaf3
commit e2547a73c9
3 changed files with 4 additions and 5 deletions

View file

@ -199,7 +199,7 @@ class ResourceLoader implements LoggerAwareInterface {
$stats = RequestContext::getMain()->getStats();
$cache = ObjectCache::newAccelerator( CACHE_ANYTHING );
$key = wfGlobalCacheKey(
$key = $cache->makeGlobalKey(
'resourceloader',
'filter',
$filter,

View file

@ -970,7 +970,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
$vars = $this->getLessVars( $context );
ksort( $vars );
$varsHash = hash( 'md4', serialize( $vars ) );
$cacheKey = wfGlobalCacheKey( 'LESS', $fileName, $varsHash );
$cacheKey = $cache->makeGlobalKey( 'LESS', $fileName, $varsHash );
$cachedCompile = $cache->get( $cacheKey );
// If we got a cached value, we have to validate it by getting a

View file

@ -874,14 +874,13 @@ abstract class ResourceLoaderModule {
protected function validateScriptFile( $fileName, $contents ) {
if ( $this->getConfig()->get( 'ResourceLoaderValidateJS' ) ) {
// Try for cache hit
// Use CACHE_ANYTHING since parsing JS is much slower than a DB query
$key = wfMemcKey(
$cache = ObjectCache::getLocalClusterInstance();
$key = $cache->makeKey(
'resourceloader',
'jsparse',
self::$parseCacheVersion,
md5( $contents )
);
$cache = wfGetCache( CACHE_ANYTHING );
$cacheEntry = $cache->get( $key );
if ( is_string( $cacheEntry ) ) {
return $cacheEntry;