wfDebugLog( 'resourceloader', __METHOD__ . ": minification failed: $exception" );
$this->hasErrors = true;
// Return exception as a comment
- $result = $this->makeComment( $exception->__toString() );
+ $result = self::makeComment( $exception->__toString() );
}
wfProfileOut( __METHOD__ );
wfDebugLog( 'resourceloader', __METHOD__ . ": request for private module '$name' denied" );
$this->hasErrors = true;
// Add exception to the output as a comment
- $errors .= $this->makeComment( "Cannot show private module \"$name\"" );
+ $errors .= self::makeComment( "Cannot show private module \"$name\"" );
continue;
}
wfDebugLog( 'resourceloader', __METHOD__ . ": preloading module info failed: $e" );
$this->hasErrors = true;
// Add exception to the output as a comment
- $errors .= $this->makeComment( $e->__toString() );
+ $errors .= self::makeComment( $e->__toString() );
}
wfProfileIn( __METHOD__ . '-getModifiedTime' );
wfDebugLog( 'resourceloader', __METHOD__ . ": calculating maximum modified time failed: $e" );
$this->hasErrors = true;
// Add exception to the output as a comment
- $errors .= $this->makeComment( $e->__toString() );
+ $errors .= self::makeComment( $e->__toString() );
}
}
// 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 = $this->makeComment( $warnings ) . $response;
+ $response = self::makeComment( $warnings ) . $response;
$this->hasErrors = true;
}
return false; // cache miss
}
- protected function makeComment( $text ) {
+ /**
+ * Generate a CSS or JS comment block
+ *
+ * @param $text string
+ * @return string
+ */
+ public static function makeComment( $text ) {
$encText = str_replace( '*/', '* /', $text );
return "/*\n$encText\n*/\n";
}
wfDebugLog( 'resourceloader', __METHOD__ . ": pre-fetching blobs from MessageBlobStore failed: $e" );
$this->hasErrors = true;
// Add exception to the output as a comment
- $exceptions .= $this->makeComment( $e->__toString() );
+ $exceptions .= self::makeComment( $e->__toString() );
}
} else {
$blobs = array();
wfDebugLog( 'resourceloader', __METHOD__ . ": generating module package failed: $e" );
$this->hasErrors = true;
// Add exception to the output as a comment
- $exceptions .= $this->makeComment( $e->__toString() );
+ $exceptions .= self::makeComment( $e->__toString() );
// Register module as missing
$missing[] = $name;