$content = $revision->getContent( Revision::RAW );
if ( !$content ) {
- wfDebug( __METHOD__ . "failed to load content of JS/CSS page!\n" );
+ wfDebugLog( 'resourceloader', __METHOD__ . ': failed to load content of JS/CSS page!' );
return null;
}
$model = $content->getModel();
if ( $model !== CONTENT_MODEL_CSS && $model !== CONTENT_MODEL_JAVASCRIPT ) {
- wfDebug( __METHOD__ . "bad content model $model for JS/CSS page!\n" );
+ wfDebugLog( 'resourceloader', __METHOD__ . ': bad content model $model for JS/CSS page!' );
return null;
}
if ( strval( $script ) !== '' ) {
$script = $this->validateScriptFile( $titleText, $script );
if ( strpos( $titleText, '*/' ) === false ) {
- $scripts .= "/* $titleText */\n";
+ $scripts .= "/* $titleText */\n";
}
$scripts .= $script . "\n";
}
$styles[$media] = array();
}
if ( strpos( $titleText, '*/' ) === false ) {
- $style = "/* $titleText */\n" . $style;
+ $style = "/* $titleText */\n" . $style;
}
$styles[$media][] = $style;
}
if ( count( $mtimes ) ) {
$modifiedTime = max( $modifiedTime, max( $mtimes ) );
}
- $modifiedTime = max( $modifiedTime, $this->getMsgBlobMtime( $context->getLanguage() ) );
+ $modifiedTime = max(
+ $modifiedTime,
+ $this->getMsgBlobMtime( $context->getLanguage() ),
+ $this->getDefinitionMtime( $context )
+ );
return $modifiedTime;
}
+ /**
+ * Get the definition summary for this module.
+ *
+ * @return Array
+ */
+ public function getDefinitionSummary( ResourceLoaderContext $context ) {
+ return array(
+ 'class' => get_class( $this ),
+ 'pages' => $this->getPages( $context ),
+ );
+ }
+
/**
* @param $context ResourceLoaderContext
* @return bool