X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FFormatMetadata.php;h=7246072ded2b6466ed1d8e59960c0e1967b2a289;hb=68aab7ca8bd2bf7271a2f69aff1e7a60ab88078b;hp=07d7618c60f46ec4260e70024671b120756620b8;hpb=76258366ba4eb90facac993086249d8f86d2a973;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 07d7618c60..7246072ded 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -1595,11 +1595,8 @@ class FormatMetadata extends ContextSource { public function fetchExtendedMetadata( File $file ) { global $wgMemc; - wfProfileIn( __METHOD__ ); - // If revision deleted, exit immediately if ( $file->isDeleted( File::DELETED_FILE ) ) { - wfProfileOut( __METHOD__ ); return array(); } @@ -1614,7 +1611,7 @@ class FormatMetadata extends ContextSource { $cachedValue = $wgMemc->get( $cacheKey ); if ( $cachedValue - && wfRunHooks( 'ValidateExtendedMetadataCache', array( $cachedValue['timestamp'], $file ) ) + && Hooks::run( 'ValidateExtendedMetadataCache', array( $cachedValue['timestamp'], $file ) ) ) { $extendedMetadata = $cachedValue['data']; } else { @@ -1634,8 +1631,6 @@ class FormatMetadata extends ContextSource { $wgMemc->set( $cacheKey, $valueToCache, $maxCacheTime ); } - wfProfileOut( __METHOD__ ); - return $extendedMetadata; } @@ -1657,8 +1652,6 @@ class FormatMetadata extends ContextSource { return $file->getExtendedMetadata() ?: array(); } - wfProfileIn( __METHOD__ ); - $uploadDate = wfTimestamp( TS_ISO_8601, $file->getTimestamp() ); $fileMetadata = array( @@ -1686,19 +1679,6 @@ class FormatMetadata extends ContextSource { ); } - $common = $file->getCommonMetaArray(); - - if ( $common !== false ) { - foreach ( $common as $key => $value ) { - $fileMetadata[$key] = array( - 'value' => $value, - 'source' => 'file-metadata', - ); - } - } - - wfProfileOut( __METHOD__ ); - return $fileMetadata; } @@ -1715,9 +1695,8 @@ class FormatMetadata extends ContextSource { protected function getExtendedMetadataFromHook( File $file, array $extendedMetadata, &$maxCacheTime ) { - wfProfileIn( __METHOD__ ); - wfRunHooks( 'GetExtendedMetadata', array( + Hooks::run( 'GetExtendedMetadata', array( &$extendedMetadata, $file, $this->getContext(), @@ -1732,8 +1711,6 @@ class FormatMetadata extends ContextSource { } } - wfProfileOut( __METHOD__ ); - return $extendedMetadata; }