<?php
-// @codingStandardsIgnoreFile
-// PHPCS can't handle the level of nesting in this file
/**
* Formatting of image metadata values into human readable form.
*
$type = 'ul'; // default unordered list.
}
- //This is done differently as the tag is an array.
+ // This is done differently as the tag is an array.
if ( $tag == 'GPSTimeStamp' && count( $vals ) === 3 ) {
- //hour min sec array
+ // hour min sec array
$h = explode( '/', $vals[0] );
$m = explode( '/', $vals[1] );
case 'PhotometricInterpretation':
switch ( $val ) {
+ case 0:
+ case 1:
case 2:
+ case 3:
+ case 4:
+ case 5:
case 6:
+ case 8:
+ case 9:
+ case 10:
+ case 32803:
+ case 34892:
$val = $this->exifMsg( $tag, $val );
break;
default:
'mode' => ( $val & bindec( '00011000' ) ) >> 3,
'function' => ( $val & bindec( '00100000' ) ) >> 5,
'redeye' => ( $val & bindec( '01000000' ) ) >> 6,
-// 'reserved' => ($val & bindec( '10000000' )) >> 7,
+// 'reserved' => ($val & bindec( '10000000' )) >> 7,
);
$flashMsgs = array();
# We do not need to handle unknown values since all are used.
}
break;
- //The GPS...Ref values are kept for compatibility, probably won't be reached.
+ // The GPS...Ref values are kept for compatibility, probably won't be reached.
case 'GPSLatitudeRef':
case 'GPSDestLatitudeRef':
switch ( $val ) {
case 'Software':
if ( is_array( $val ) ) {
- //if its a software, version array.
+ // if its a software, version array.
$val = $this->msg( 'exif-software-version-value', $val[0], $val[1] )->text();
} else {
$val = $this->exifMsg( $tag, '', $val );
$lowLang = strtolower( $lang );
$langName = Language::fetchLanguageName( $lowLang );
if ( $langName === '' ) {
- //try just the base language name. (aka en-US -> en ).
+ // try just the base language name. (aka en-US -> en ).
list( $langPrefix ) = explode( '-', $lowLang, 2 );
$langName = Language::fetchLanguageName( $langPrefix );
if ( $langName === '' ) {
* @since 1.23
*/
public function fetchExtendedMetadata( File $file ) {
- global $wgMemc;
+ $cache = ObjectCache::getMainWANInstance();
// If revision deleted, exit immediately
if ( $file->isDeleted( File::DELETED_FILE ) ) {
$file->getSha1()
);
- $cachedValue = $wgMemc->get( $cacheKey );
+ $cachedValue = $cache->get( $cacheKey );
if (
$cachedValue
&& Hooks::run( 'ValidateExtendedMetadataCache', array( $cachedValue['timestamp'], $file ) )
// computation on a cache hit.
$this->sanitizeArrayForAPI( $extendedMetadata );
$valueToCache = array( 'data' => $extendedMetadata, 'timestamp' => wfTimestampNow() );
- $wgMemc->set( $cacheKey, $valueToCache, $maxCacheTime );
+ $cache->set( $cacheKey, $valueToCache, $maxCacheTime );
}
return $extendedMetadata;