28use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
31use Wikimedia\Timestamp\TimestampException;
55 use ProtectedHookAccessorTrait;
71 $this->singleLang = $val;
93 return $obj->makeFormattedData( $tags );
108 $resolutionunit = !isset( $tags[
'ResolutionUnit'] ) || $tags[
'ResolutionUnit'] == 2 ? 2 : 3;
109 unset( $tags[
'ResolutionUnit'] );
112 unset( $tags[
'HasExtendedXMP'] );
113 unset( $tags[
'AuthorsPosition'] );
114 unset( $tags[
'LocationCreated'] );
115 unset( $tags[
'LocationShown'] );
116 unset( $tags[
'GPSAltitudeRef'] );
118 foreach ( $tags as $tag => &$vals ) {
121 if ( !is_array( $vals ) ) {
126 if ( isset( $vals[
'_type'] ) ) {
127 $type = $vals[
'_type'];
128 unset( $vals[
'_type'] );
135 if ( isset( $tags[$tag][
'_formatted'] ) ) {
137 $tags[$tag][
'_formatted'],
$type
143 if ( $tag ==
'GPSTimeStamp' && count( $vals ) === 3 ) {
146 $h = explode(
'/', $vals[0] );
147 $m = explode(
'/', $vals[1] );
148 $s = explode(
'/', $vals[2] );
163 $vals = str_pad( intval( $h[0] / $h[1] ), 2,
'0', STR_PAD_LEFT )
164 .
':' . str_pad( intval( $m[0] / $m[1] ), 2,
'0', STR_PAD_LEFT )
165 .
':' . str_pad( intval(
$s[0] /
$s[1] ), 2,
'0', STR_PAD_LEFT );
168 $time =
wfTimestamp( TS_MW,
'1971:01:01 ' . $vals );
170 if ( $time && intval( $time ) > 0 ) {
173 }
catch ( TimestampException $e ) {
184 if ( $tag ===
'Contact' || $tag ===
'CreatorContactInfo' ) {
189 foreach ( $vals as &$val ) {
204 $val = $this->
exifMsg( $tag, $val );
213 case 'PhotometricInterpretation':
227 $val = $this->
exifMsg( $tag, $val );
246 $val = $this->
exifMsg( $tag, $val );
255 case 'PlanarConfiguration':
259 $val = $this->
exifMsg( $tag, $val );
269 case 'YCbCrPositioning':
273 $val = $this->
exifMsg( $tag, $val );
284 switch ( $resolutionunit ) {
305 case 'FlashPixVersion':
308 case 'FlashpixVersion':
309 $val = $this->
literal( (
int)$val / 100 );
316 $val = $this->
exifMsg( $tag, $val );
325 case 'ComponentsConfiguration':
334 $val = $this->
exifMsg( $tag, $val );
344 case 'DateTimeOriginal':
345 case 'DateTimeDigitized':
346 case 'DateTimeReleased':
347 case 'DateTimeExpires':
350 case 'DateTimeMetadata':
351 case 'FirstPhotoDate':
352 case 'LastPhotoDate':
353 if ( $val ==
'0000:00:00 00:00:00' || $val ==
' : : : : ' ) {
354 $val = $this->
msg(
'exif-unknowndate' )->text();
356 } elseif ( preg_match(
357 '/^(?:\d{4}):(?:\d\d):(?:\d\d) (?:\d\d):(?:\d\d):(?:\d\d)$/D',
362 if ( $time && intval( $time ) > 0 ) {
366 } elseif ( preg_match(
'/^(?:\d{4}):(?:\d\d):(?:\d\d) (?:\d\d):(?:\d\d)$/D', $val ) ) {
371 if ( $time && intval( $time ) > 0 ) {
375 } elseif ( preg_match(
'/^(?:\d{4}):(?:\d\d):(?:\d\d)$/D', $val ) ) {
378 . substr( $val, 5, 2 )
379 . substr( $val, 8, 2 )
381 if ( $time && intval( $time ) > 0 ) {
390 case 'ExposureProgram':
401 $val = $this->
exifMsg( $tag, $val );
410 case 'SubjectDistance':
425 $val = $this->
exifMsg( $tag, $val );
457 $val = $this->
exifMsg( $tag, $val );
468 'fired' => $val & 0b00000001,
469 'return' => ( $val & 0b00000110 ) >> 1,
470 'mode' => ( $val & 0b00011000 ) >> 3,
471 'function' => ( $val & 0b00100000 ) >> 5,
472 'redeye' => ( $val & 0b01000000 ) >> 6,
476 # We do not need to handle unknown values since all are used.
477 foreach ( $flashDecode as $subTag => $subValue ) {
478 # We do not need any message for zeroed values.
479 if ( $subTag !=
'fired' && $subValue == 0 ) {
482 $fullTag = $tag .
'-' . $subTag;
483 $flashMsgs[] = $this->
exifMsg( $fullTag, $subValue );
485 $val = $this->
getLanguage()->commaList( $flashMsgs );
488 case 'FocalPlaneResolutionUnit':
491 $val = $this->
exifMsg( $tag, $val );
500 case 'SensingMethod':
509 $val = $this->
exifMsg( $tag, $val );
521 $val = $this->
exifMsg( $tag, $val );
533 $val = $this->
exifMsg( $tag, $val );
542 case 'CustomRendered':
554 $val = $this->
exifMsg( $tag, $val );
568 $val = $this->
exifMsg( $tag, $val );
580 $val = $this->
exifMsg( $tag, $val );
589 case 'SceneCaptureType':
595 $val = $this->
exifMsg( $tag, $val );
611 $val = $this->
exifMsg( $tag, $val );
625 $val = $this->
exifMsg( $tag, $val );
639 $val = $this->
exifMsg( $tag, $val );
653 $val = $this->
exifMsg( $tag, $val );
662 case 'SubjectDistanceRange':
668 $val = $this->
exifMsg( $tag, $val );
678 case 'GPSLatitudeRef':
679 case 'GPSDestLatitudeRef':
683 $val = $this->
exifMsg(
'GPSLatitude', $val );
692 case 'GPSLongitudeRef':
693 case 'GPSDestLongitudeRef':
697 $val = $this->
exifMsg(
'GPSLongitude', $val );
708 $val = $this->
exifMsg(
'GPSAltitude',
'below-sealevel', $this->
formatNum( -$val, 3 ) );
710 $val = $this->
exifMsg(
'GPSAltitude',
'above-sealevel', $this->
formatNum( $val, 3 ) );
718 $val = $this->
exifMsg( $tag, $val );
727 case 'GPSMeasureMode':
731 $val = $this->
exifMsg( $tag, $val );
741 case 'GPSImgDirectionRef':
742 case 'GPSDestBearingRef':
746 $val = $this->
exifMsg(
'GPSDirection', $val );
756 case 'GPSDestLatitude':
760 case 'GPSDestLongitude':
769 $val = $this->
exifMsg(
'GPSSpeed', $val );
778 case 'GPSDestDistanceRef':
783 $val = $this->
exifMsg(
'GPSDestDistance', $val );
796 } elseif ( $val <= 5 ) {
798 } elseif ( $val <= 10 ) {
800 } elseif ( $val <= 20 ) {
816 if ( is_array( $val ) ) {
817 if ( count( $val ) > 1 ) {
820 'exif-software-version-value',
835 $val = $this->
msg(
'exif-exposuretime-format',
838 case 'ISOSpeedRatings':
842 if ( $val ==
'65535' ) {
843 $val = $this->
exifMsg( $tag,
'overflow' );
849 $val = $this->
msg(
'exif-fnumber-format',
854 case 'FocalLengthIn35mmFilm':
855 $val = $this->
msg(
'exif-focallength-format',
859 case 'MaxApertureValue':
860 if ( strpos( $val,
'/' ) !==
false ) {
862 list( $n, $d ) = explode(
'/', $val );
863 if ( is_numeric( $n ) && is_numeric( $d ) ) {
867 if ( is_numeric( $val ) ) {
868 $fNumber = 2 ** ( $val / 2 );
869 if ( is_finite( $fNumber ) ) {
870 $val = $this->
msg(
'exif-maxaperturevalue-value',
881 switch ( strtolower( $val ) ) {
910 case 'SubjectNewsCode':
922 if ( $val == 0 || $val == 9 ) {
924 } elseif ( $val < 5 && $val > 1 ) {
926 } elseif ( $val == 5 ) {
928 } elseif ( $val <= 8 && $val > 5 ) {
932 if ( $urgency !==
'' ) {
933 $val = $this->
exifMsg(
'urgency',
934 $urgency, $this->
literal( $val )
942 case 'OriginalImageHeight':
943 case 'OriginalImageWidth':
944 case 'PixelXDimension':
945 case 'PixelYDimension':
948 $val = $this->
formatNum( $val ) .
' ' . $this->
msg(
'unit-pixel' )->text();
958 case 'ImageDescription':
962 case 'RelatedSoundFile':
963 case 'ImageUniqueID':
964 case 'SpectralSensitivity':
965 case 'GPSSatellites':
969 case 'WorldRegionDest':
971 case 'CountryCodeDest':
972 case 'ProvinceOrStateDest':
974 case 'SublocationDest':
975 case 'WorldRegionCreated':
976 case 'CountryCreated':
977 case 'CountryCodeCreated':
978 case 'ProvinceOrStateCreated':
980 case 'SublocationCreated':
982 case 'SpecialInstructions':
987 case 'FixtureIdentifier':
989 case 'LocationDestCode':
991 case 'JPEGFileComment':
992 case 'iimSupplementalCategory':
993 case 'OriginalTransmissionRef':
995 case 'dc-contributor':
1003 case 'SerialNumber':
1004 case 'CameraOwnerName':
1007 case 'RightsCertificate':
1008 case 'CopyrightOwner':
1010 case 'WebStatement':
1011 case 'OriginalDocumentID':
1013 case 'MorePermissionsUrl':
1014 case 'AttributionUrl':
1015 case 'PreferredAttributionName':
1016 case 'PNGFileComment':
1018 case 'ContentWarning':
1019 case 'GIFFileComment':
1021 case 'IntellectualGenre':
1023 case 'OrganisationInImage':
1024 case 'PersonInImage':
1025 case 'CaptureSoftware':
1026 case 'GPSAreaInformation':
1027 case 'GPSProcessingMethod':
1028 case 'StitchingSoftware':
1030 case 'SubSecTimeOriginal':
1031 case 'SubSecTimeDigitized':
1032 $val = $this->
literal( $val );
1035 case 'ProjectionType':
1037 case 'equirectangular':
1038 $val = $this->
exifMsg( $tag, $val );
1041 $val = $this->
literal( $val );
1050 $val = $this->
exifMsg( $tag, $val );
1053 $val = $this->
literal( $val );
1058 case 'UsePanoramaViewer':
1059 case 'ExposureLockUsed':
1063 $val = $this->
exifMsg( $tag, $val );
1066 $val = $this->
literal( $val );
1071 if ( $val ==
'-1' ) {
1072 $val = $this->
exifMsg( $tag,
'rejected' );
1078 case 'LanguageCode':
1079 $lang = MediaWikiServices::getInstance()
1080 ->getLanguageNameUtils()
1081 ->getLanguageName( strtolower( $val ), $this->
getLanguage()->getCode() );
1086 $val = $this->
formatNum( $val,
false, $tag );
1124 wfDeprecated( __METHOD__ .
' with $noHtml = true',
'1.36' );
1131 $context->setLanguage( MediaWikiServices::getInstance()->getContentLanguage() );
1134 return $obj->flattenArrayReal( $vals,
$type, $noHtml );
1155 if ( !is_array( $vals ) ) {
1159 if ( isset( $vals[
'_type'] ) ) {
1160 $type = $vals[
'_type'];
1161 unset( $vals[
'_type'] );
1164 if ( count( $vals ) === 1 &&
$type !==
'lang' && isset( $vals[0] ) ) {
1166 } elseif ( count( $vals ) === 0 ) {
1167 wfDebug( __METHOD__ .
" metadata array with 0 elements!" );
1186 $defaultItem =
false;
1187 $defaultLang =
false;
1196 if ( isset( $vals[
'x-default'] ) ) {
1197 $defaultItem = $vals[
'x-default'];
1198 unset( $vals[
'x-default'] );
1200 foreach ( $priorityLanguages as $pLang ) {
1201 if ( isset( $vals[$pLang] ) ) {
1203 if ( $vals[$pLang] === $defaultItem ) {
1204 $defaultItem =
false;
1208 $vals[$pLang], $pLang,
1209 $isDefault, $noHtml );
1211 unset( $vals[$pLang] );
1213 if ( $this->singleLang ) {
1214 return Html::rawElement(
'span',
1215 [
'lang' => $pLang ], $vals[$pLang] );
1221 foreach ( $vals as
$lang => $item ) {
1222 if ( $item === $defaultItem ) {
1223 $defaultLang =
$lang;
1227 $lang,
false, $noHtml );
1228 if ( $this->singleLang ) {
1229 return Html::rawElement(
'span',
1230 [
'lang' =>
$lang ], $item );
1233 if ( $defaultItem !==
false ) {
1235 $defaultLang,
true, $noHtml ) .
1237 if ( $this->singleLang ) {
1238 return $defaultItem;
1245 return '<ul class="metadata-langlist">' .
1250 return "\n#" . implode(
"\n#", $vals );
1253 return "<ol><li>" . implode(
"</li>\n<li>", $vals ) .
'</li></ol>';
1257 return "\n*" . implode(
"\n*", $vals );
1260 return "<ul><li>" . implode(
"</li>\n<li>", $vals ) .
'</li></ul>';
1276 if (
$lang ===
false && $default ===
false ) {
1277 throw new MWException(
'$lang and $default cannot both '
1282 $wrappedValue = $this->
literal( $value );
1284 $wrappedValue =
'<span class="mw-metadata-lang-value">'
1285 . $this->
literal( $value ) .
'</span>';
1288 if (
$lang ===
false ) {
1289 $msg = $this->
msg(
'metadata-langitem-default', $wrappedValue );
1291 return $msg->text() .
"\n\n";
1294 return '<li class="mw-metadata-lang-default">'
1299 $lowLang = strtolower(
$lang );
1300 $languageNameUtils = MediaWikiServices::getInstance()->getLanguageNameUtils();
1301 $langName = $languageNameUtils->getLanguageName( $lowLang );
1302 if ( $langName ===
'' ) {
1304 $langPrefix = explode(
'-', $lowLang, 2 )[0];
1305 $langName = $languageNameUtils->getLanguageName( $langPrefix );
1306 if ( $langName ===
'' ) {
1313 $msg = $this->
msg(
'metadata-langitem', $wrappedValue, $langName,
$lang );
1315 return '*' . $msg->text();
1318 $item =
'<li class="mw-metadata-lang-code-'
1321 $item .=
' mw-metadata-lang-default';
1323 $item .=
'" lang="' .
$lang .
'">';
1324 $item .= $msg->text();
1342 return htmlspecialchars( $val );
1354 private function exifMsg( $tag, $val, $arg =
null, $arg2 =
null ) {
1355 if ( $val ===
'' ) {
1360 MediaWikiServices::getInstance()->getContentLanguage()->lc(
"exif-$tag-$val" ),
1375 private function formatNum( $num, $round =
false, $tagName =
null ) {
1377 if ( is_array( $num ) ) {
1379 foreach ( $num as $number ) {
1380 $out[] = $this->
formatNum( $number, $round, $tagName );
1385 if ( is_numeric( $num ) ) {
1386 if ( $round !==
false ) {
1387 $num = round( $num, $round );
1391 if ( preg_match(
'/^(-?\d+)\/(\d+)$/', $num, $m ) ) {
1393 $newNum = $m[1] / $m[2];
1394 if ( $round !==
false ) {
1395 $newNum = round( $newNum, $round );
1401 return $this->
getLanguage()->formatNum( $newNum );
1403 # T267370: there are a lot of strange EXIF tags floating around.
1404 LoggerFactory::getInstance(
'formatnum' )->warning(
1405 'FormatMetadata::formatNum with non-numeric value',
1411 return $this->
literal( $num );
1422 if ( preg_match(
'/^(-?\d+)\/(\d+)$/', $num, $m ) ) {
1423 $numerator = intval( $m[1] );
1424 $denominator = intval( $m[2] );
1425 $gcd = $this->
gcd( abs( $numerator ), $denominator );
1428 return $this->
formatNum( $numerator / $gcd ) .
'/' . $this->
formatNum( $denominator / $gcd );
1442 private function gcd( $a, $b ) {
1452 $remainder = $a % $b;
1475 if ( !preg_match(
'/^\d{8}$/D', $val ) ) {
1480 switch ( substr( $val, 0, 2 ) ) {
1533 if ( $cat !==
'' ) {
1534 $catMsg = $this->
exifMsg(
'iimcategory', $cat );
1535 $val = $this->
exifMsg(
'subjectnewscode',
'', $this->
literal( $val ), $catMsg );
1550 if ( !is_numeric( $coord ) ) {
1551 wfDebugLog(
'exif', __METHOD__ .
": \"$coord\" is not a number" );
1552 return $this->
literal( (
string)$coord );
1558 if (
$type ===
'latitude' ) {
1560 } elseif (
$type ===
'longitude' ) {
1564 $nCoord = (float)$coord;
1565 if (
$type ===
'latitude' ) {
1567 } elseif (
$type ===
'longitude' ) {
1572 $deg = floor( $nCoord );
1573 $min = floor( ( $nCoord - $deg ) * 60 );
1574 $sec = round( ( ( $nCoord - $deg ) * 60 - $min ) * 60, 2 );
1581 return $this->
msg(
'exif-coordinate-format', $deg, $min, $sec, $ref, $this->
literal( $coord ) )->text();
1599 if ( !( isset( $vals[
'CiAdrExtadr'] )
1600 || isset( $vals[
'CiAdrCity'] )
1601 || isset( $vals[
'CiAdrCtry'] )
1602 || isset( $vals[
'CiEmailWork'] )
1603 || isset( $vals[
'CiTelWork'] )
1604 || isset( $vals[
'CiAdrPcode'] )
1605 || isset( $vals[
'CiAdrRegion'] )
1606 || isset( $vals[
'CiUrlWork'] )
1615 foreach ( $vals as &$val ) {
1616 $val = $this->
literal( $val );
1624 $url = $tel = $street = $city = $country =
'';
1625 $email = $postal = $region =
'';
1634 if ( isset( $vals[
'CiAdrExtadr'] ) ) {
1637 $street =
'<span class="extended-address">'
1639 $vals[
'CiAdrExtadr'] )
1642 if ( isset( $vals[
'CiAdrCity'] ) ) {
1643 $city =
'<span class="locality">'
1644 . $this->
literal( $vals[
'CiAdrCity'] )
1647 if ( isset( $vals[
'CiAdrCtry'] ) ) {
1648 $country =
'<span class="country-name">'
1649 . $this->
literal( $vals[
'CiAdrCtry'] )
1652 if ( isset( $vals[
'CiEmailWork'] ) ) {
1655 $splitEmails = explode(
"\n", $vals[
'CiEmailWork'] );
1656 foreach ( $splitEmails as $e1 ) {
1658 foreach ( explode(
',', $e1 ) as $e2 ) {
1659 $finalEmail = trim( $e2 );
1660 if ( $finalEmail ==
',' || $finalEmail ==
'' ) {
1663 if ( strpos( $finalEmail,
'<' ) !==
false ) {
1666 $emails[] = $this->
literal( $finalEmail );
1668 $emails[] =
'[mailto:'
1670 .
' <span class="email">'
1671 . $this->
literal( $finalEmail )
1676 $email = implode(
', ', $emails );
1678 if ( isset( $vals[
'CiTelWork'] ) ) {
1679 $tel =
'<span class="tel">'
1680 . $this->
literal( $vals[
'CiTelWork'] )
1683 if ( isset( $vals[
'CiAdrPcode'] ) ) {
1684 $postal =
'<span class="postal-code">'
1686 $vals[
'CiAdrPcode'] )
1689 if ( isset( $vals[
'CiAdrRegion'] ) ) {
1691 $region =
'<span class="region">'
1693 $vals[
'CiAdrRegion'] )
1696 if ( isset( $vals[
'CiUrlWork'] ) ) {
1697 $url =
'<span class="url">'
1698 . $this->
literal( $vals[
'CiUrlWork'] )
1702 return $this->
msg(
'exif-contact-value', $email, $url,
1703 $street, $city, $region, $postal, $country,
1716 $lines = explode(
"\n",
wfMessage(
'metadata-fields' )->inContentLanguage()->text() );
1719 if ( preg_match(
'/^\\*\s*(.*?)\s*$/',
$line,
$matches ) ) {
1723 $fields = array_map(
'strtolower', $fields );
1736 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1739 if (
$file->isDeleted( File::DELETED_FILE ) ) {
1743 $cacheKey =
$cache->makeKey(
1744 'getExtendedMetadata',
1746 (
int)$this->singleLang,
1750 $cachedValue =
$cache->get( $cacheKey );
1753 && $this->getHookRunner()->onValidateExtendedMetadataCache( $cachedValue[
'timestamp'],
$file )
1755 $extendedMetadata = $cachedValue[
'data'];
1760 if ( $this->singleLang ) {
1769 $valueToCache = [
'data' => $extendedMetadata,
'timestamp' =>
wfTimestampNow() ];
1770 $cache->set( $cacheKey, $valueToCache, $maxCacheTime );
1773 return $extendedMetadata;
1791 return $file->getExtendedMetadata() ?: [];
1799 'value' => $uploadDate,
1800 'source' =>
'mediawiki-metadata',
1806 $text =
$title->getText();
1807 $pos = strrpos( $text,
'.' );
1810 $name = substr( $text, 0, $pos );
1815 $fileMetadata[
'ObjectName'] = [
1817 'source' =>
'mediawiki-metadata',
1821 return $fileMetadata;
1837 $this->getHookRunner()->onGetExtendedMetadata(
1845 $visible = array_fill_keys( self::getVisibleFields(),
true );
1846 foreach ( $extendedMetadata as $key => $value ) {
1847 if ( !isset( $visible[strtolower( $key )] ) ) {
1848 $extendedMetadata[$key][
'hidden'] =
'';
1852 return $extendedMetadata;
1866 || !isset( $value[
'_type'] )
1867 || $value[
'_type'] !=
'lang'
1874 foreach ( $priorityLanguages as
$lang ) {
1875 if ( isset( $value[
$lang] ) ) {
1876 return $value[
$lang];
1881 if ( isset( $value[
'x-default'] ) ) {
1882 return $value[
'x-default'];
1886 unset( $value[
'_type'] );
1887 if ( !empty( $value ) ) {
1888 return reset( $value );
1905 if ( !is_array( $value ) ) {
1907 } elseif ( isset( $value[
'_type'] ) && $value[
'_type'] ===
'lang' ) {
1910 foreach ( $value as $k => $v ) {
1915 $v = reset( $value );
1916 if ( key( $value ) ===
'_type' ) {
1917 $v = next( $value );
1930 if ( !is_array( $metadata ) ) {
1933 foreach ( $metadata as &$field ) {
1934 if ( isset( $field[
'value'] ) ) {
1947 if ( !is_array( $metadata ) ) {
1950 foreach ( $metadata as $key => &$field ) {
1951 if ( $key ===
'Software' || $key ===
'Contact' ) {
1956 if ( isset( $field[
'value'] ) ) {
1967 if ( !is_array( $arr ) ) {
1972 foreach ( $arr as $key => &$value ) {
1974 if ( $sanitizedKey !== $key ) {
1975 if ( isset( $arr[$sanitizedKey] ) ) {
1980 $sanitizedKey .= $counter;
1983 $arr[$sanitizedKey] = $arr[$key];
1984 unset( $arr[$key] );
1986 if ( is_array( $value ) ) {
1992 $keys = array_filter( array_keys( $arr ), [ ApiResult::class,
'isMetadataKey' ] );
1994 ApiResult::setPreserveKeysList( $arr,
$keys );
2008 $key = preg_replace(
'/[^a-zA-z0-9_:.\-]/',
'', $key );
2010 $key = preg_replace(
'/^[\d\-.]+/',
'', $key );
2012 if ( $key ===
'' ) {
2015 } elseif ( $key ===
'_element' ) {
2029 $priorityLanguages = MediaWikiServices::getInstance()
2030 ->getLanguageFallback()
2031 ->getAllIncludingSiteLanguage( $this->
getLanguage()->getCode() );
2032 $priorityLanguages = array_merge(
2034 $priorityLanguages[0],
2035 $priorityLanguages[1]
2038 return $priorityLanguages;
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
getContext()
Get the base IContextSource object.
setContext(IContextSource $context)
An IContextSource implementation which will inherit context from another source but allow individual ...
Implements some public methods and some protected utility functions which are required by multiple ch...
Foreign file accessible through api.php requests.
Interface for objects which can provide a MediaWiki context on request.
foreach( $mmfl['setupFiles'] as $fileName) if($queue) if(empty( $mmfl['quiet'])) $s
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
if(!isset( $args[0])) $lang
if(!file_exists( $CREDITS)) $lines