$stats = RequestContext::getMain()->getStats();
$cache = ObjectCache::newAccelerator( CACHE_ANYTHING );
- $key = wfGlobalCacheKey(
+ $key = $cache->makeGlobalKey(
'resourceloader',
'filter',
$filter,
// Allow multiple modules to be registered in one call
$registrations = is_array( $name ) ? $name : array( $name => $info );
foreach ( $registrations as $name => $info ) {
- // Disallow duplicate registrations
+ // Warn on duplicate registrations
if ( isset( $this->moduleInfos[$name] ) ) {
// A module has already been registered by this name
- throw new MWException(
- 'ResourceLoader duplicate registration error. ' .
+ $this->logger->warning(
+ 'ResourceLoader duplicate registration warning. ' .
'Another module has already been registered as ' . $name
);
}
// Capture any PHP warnings from the output buffer and append them to the
// error list if we're in debug mode.
- if ( $context->getDebug() && strlen( $warnings = ob_get_contents() ) ) {
- $this->errors[] = $warnings;
+ if ( $context->getDebug() ) {
+ $warnings = ob_get_contents();
+ if ( strlen( $warnings ) ) {
+ $this->errors[] = $warnings;
+ }
}
// Save response to file cache unless there are errors
$response = $fileCache->fetchText();
// Capture any PHP warnings from the output buffer and append them to the
// response in a comment if we're in debug mode.
- if ( $context->getDebug() && strlen( $warnings = ob_get_contents() ) ) {
- $response = self::makeComment( $warnings ) . $response;
+ if ( $context->getDebug() ) {
+ $warnings = ob_get_contents();
+ if ( strlen( $warnings ) ) {
+ $response = self::makeComment( $warnings ) . $response;
+ }
}
// Remove the output buffer and output the response
ob_end_clean();
* Returns LESS compiler set up for use with MediaWiki
*
* @since 1.22
- * @since 1.26 added $extraVars parameter
+ * @since 1.27 added $extraVars parameter
* @param Config $config
* @param array $extraVars Associative array of extra (i.e., other than the
* globally-configured ones) that should be used for compilation.