}
// Defaults
$options += array( 'cache' => true, 'cacheReport' => false );
+ $stats = RequestContext::getMain()->getStats();
// Don't filter empty content
if ( trim( $data ) === '' ) {
$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 */";
}
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() ) );
}
$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 );
}
/**
$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 );
}
/**
$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;
}