X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoader.php;h=b8ec63bb299998afa35721de02f703742e1e723b;hb=9e06b91a743b9f27a726c923bd48f32a0c1d5a11;hp=cd07334513b48150c70acc5b5d663b797bcbc622;hpb=acbc16b623a5fd50226d3119f2c101b1165578b9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index cd07334513..b8ec63bb29 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -191,6 +191,7 @@ class ResourceLoader implements LoggerAwareInterface { } // Defaults $options += array( 'cache' => true, 'cacheReport' => false ); + $stats = RequestContext::getMain()->getStats(); // Don't filter empty content if ( trim( $data ) === '' ) { @@ -211,17 +212,16 @@ class ResourceLoader implements LoggerAwareInterface { $cache = wfGetCache( wfIsHHVM() ? CACHE_ACCEL : CACHE_ANYTHING ); $cacheEntry = $cache->get( $key ); if ( is_string( $cacheEntry ) ) { - wfIncrStats( "resourceloader_cache.$filter.hit" ); + $stats->increment( "resourceloader_cache.$filter.hit" ); return $cacheEntry; } $result = ''; try { - $stats = RequestContext::getMain()->getStats(); $statStart = microtime( true ); - $result = self::applyFilter( $filter, $data, $this->config ); - - $stats->timing( "resourceloader_cache.$filter.miss", microtime( true ) - $statStart ); + $statTiming = microtime( true ) - $statStart; + $stats->increment( "resourceloader_cache.$filter.miss" ); + $stats->timing( "resourceloader_cache.$filter.timing", 1000 * $statTiming ); if ( $options['cacheReport'] ) { $result .= "\n/* cache key: $key */"; } @@ -811,7 +811,7 @@ class ResourceLoader implements LoggerAwareInterface { header( 'Cache-Control: private, no-cache, must-revalidate' ); header( 'Pragma: no-cache' ); } else { - header( "Cache-Control: public, must-revalidate, max-age=$maxage, s-maxage=$smaxage" ); + header( "Cache-Control: public, max-age=$maxage, s-maxage=$smaxage" ); $exp = min( $maxage, $smaxage ); header( 'Expires: ' . wfTimestamp( TS_RFC2822, $exp + time() ) ); } @@ -1485,9 +1485,7 @@ MESSAGE; $query = self::createLoaderQuery( $context, $extraQuery ); $script = $this->getLoadScript( $source ); - // Prevent the IE6 extension check from being triggered (bug 28840) - // by appending a character that's invalid in Windows extensions ('*') - return wfExpandUrl( wfAppendQuery( $script, $query ) . '&*', PROTO_RELATIVE ); + return wfExpandUrl( wfAppendQuery( $script, $query ), PROTO_RELATIVE ); } /** @@ -1515,9 +1513,7 @@ MESSAGE; $only, $printable, $handheld, $extraQuery ); - // Prevent the IE6 extension check from being triggered (bug 28840) - // by appending a character that's invalid in Windows extensions ('*') - return wfExpandUrl( wfAppendQuery( $wgLoadScript, $query ) . '&*', PROTO_RELATIVE ); + return wfExpandUrl( wfAppendQuery( $wgLoadScript, $query ), PROTO_RELATIVE ); } /** @@ -1629,9 +1625,6 @@ MESSAGE; $less->setPreserveComments( true ); $less->setVariables( self::getLessVars( $config ) ); $less->setImportDir( $config->get( 'ResourceLoaderLESSImportPaths' ) ); - foreach ( $config->get( 'ResourceLoaderLESSFunctions' ) as $name => $func ) { - $less->registerFunction( $name, $func ); - } return $less; }