X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=blobdiff_plain;f=includes%2Fmedia%2FFormatMetadata.php;h=69982c2fb4f2d5e0e02e5180d1e7d2c2411327e6;hb=171255101f2a6480f237f54af64bc29d8ce50ac3;hp=fffc262ede988bc4e395e16b31ae7540c2c8ba65;hpb=0e0d2bc6d7db3711e27d444424bb1c30c4631581;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index fffc262ede..69982c2fb4 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -24,6 +24,8 @@ * @see http://exif.org/Exif2-2.PDF The Exif 2.2 specification * @file */ +use MediaWiki\MediaWikiServices; +use Wikimedia\Timestamp\TimestampException; /** * Format Image metadata values into a human readable form. @@ -102,7 +104,6 @@ class FormatMetadata extends ContextSource { unset( $tags['ResolutionUnit'] ); foreach ( $tags as $tag => &$vals ) { - // This seems ugly to wrap non-array's in an array just to unwrap again, // especially when most of the time it is not an array if ( !is_array( $tags[$tag] ) ) { @@ -165,7 +166,6 @@ class FormatMetadata extends ContextSource { } foreach ( $vals as &$val ) { - switch ( $tag ) { case 'Compression': switch ( $val ) { @@ -1582,14 +1582,14 @@ class FormatMetadata extends ContextSource { * @since 1.23 */ public function fetchExtendedMetadata( File $file ) { - $cache = ObjectCache::getMainWANInstance(); + $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); // If revision deleted, exit immediately if ( $file->isDeleted( File::DELETED_FILE ) ) { return []; } - $cacheKey = wfMemcKey( + $cacheKey = $cache->makeKey( 'getExtendedMetadata', $this->getLanguage()->getCode(), (int)$this->singleLang, @@ -1683,7 +1683,6 @@ class FormatMetadata extends ContextSource { protected function getExtendedMetadataFromHook( File $file, array $extendedMetadata, &$maxCacheTime ) { - Hooks::run( 'GetExtendedMetadata', [ &$extendedMetadata, $file, @@ -1807,7 +1806,6 @@ class FormatMetadata extends ContextSource { $field['value'] = $this->resolveMultivalueValue( $field['value'] ); } } - } /**