From: Ori Livneh Date: Mon, 19 Oct 2015 17:00:50 +0000 (-0700) Subject: Update ResourceLoader for Ib7fc2f939b X-Git-Tag: 1.31.0-rc.0~9342^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=e2547a73c922f15ac18dd2b3b4d3298b7339f080;p=lhc%2Fweb%2Fwiklou.git Update ResourceLoader for Ib7fc2f939b Use BagOStuff::makeKey() and BagOStuff::makeGlobalKey() instead of wfMemcKey() and wfGlobalCacheKey(). Change-Id: Id4e58c0e616b74de220faf13ba7c9ea606fef8c1 --- diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 1221a2d321..c9c60bc844 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -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, diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index bc17821a15..1b827dbae1 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -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 diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index c50e8b2661..714a8ffc3e 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -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;