X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FMediaHandler.php;h=dd764e9ad1b9d1286f942e939bea357578d5530f;hb=0a32a34775b8f8042868a14903d3c217cf2c46bc;hp=e883b7f8ec72c96a69da6888184d77f3f5b5055c;hpb=7ab935b039e67242b8607335b78f4e85c0eaed0d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index e883b7f8ec..dd764e9ad1 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -243,6 +243,15 @@ abstract class MediaHandler { return array( $ext, $mime ); } + /** + * Get useful response headers for GET/HEAD requests for a file with the given metadata + * @param $metadata mixed Result of the getMetadata() function of this handler for a file + * @return Array + */ + public function getStreamHeaders( $metadata ) { + return array(); + } + /** * True if the handled types can be transformed * @return bool @@ -269,6 +278,19 @@ abstract class MediaHandler { * @return bool */ function isVectorized( $file ) { return false; } + /** + * The material is an image, and is animated. + * In particular, video material need not return true. + * @note Before 1.20, this was a method of ImageHandler only + * @return bool + */ + function isAnimatedImage( $file ) { return false; } + /** + * If the material is animated, we can animate the thumbnail + * @since 1.20 + * @return bool If material is not animated, handler may return any value. + */ + function canAnimateThumbnail( $file ) { return true; } /** * False if the handler is disabled for all files * @return bool @@ -372,7 +394,7 @@ abstract class MediaHandler { */ function visibleMetadataFields() { $fields = array(); - $lines = explode( "\n", wfMsgForContent( 'metadata-fields' ) ); + $lines = explode( "\n", wfMessage( 'metadata-fields' )->inContentLanguage()->text() ); foreach( $lines as $line ) { $matches = array(); if( preg_match( '/^\\*\s*(.*?)\s*$/', $line, $matches ) ) {