Go to the documentation of this file.
28 use Wikimedia\Timestamp\TimestampException;
66 $this->singleLang = $val;
88 return $obj->makeFormattedData( $tags );
103 $resolutionunit = !isset( $tags[
'ResolutionUnit'] ) || $tags[
'ResolutionUnit'] == 2 ? 2 : 3;
104 unset( $tags[
'ResolutionUnit'] );
106 foreach ( $tags
as $tag => &$vals ) {
109 if ( !is_array( $tags[$tag] ) ) {
114 if ( isset( $tags[$tag][
'_type'] ) ) {
115 $type = $tags[$tag][
'_type'];
116 unset( $vals[
'_type'] );
122 if ( $tag ==
'GPSTimeStamp' &&
count( $vals ) === 3 ) {
125 $h = explode(
'/', $vals[0] );
126 $m = explode(
'/', $vals[1] );
127 $s = explode(
'/', $vals[2] );
142 $tags[$tag] = str_pad( intval( $h[0] / $h[1] ), 2,
'0', STR_PAD_LEFT )
143 .
':' . str_pad( intval( $m[0] / $m[1] ), 2,
'0', STR_PAD_LEFT )
144 .
':' . str_pad( intval(
$s[0] /
$s[1] ), 2,
'0', STR_PAD_LEFT );
152 }
catch ( TimestampException
$e ) {
163 if ( $tag ===
'Contact' ) {
168 foreach ( $vals
as &$val ) {
183 $val = $this->
exifMsg( $tag, $val );
191 case 'PhotometricInterpretation':
205 $val = $this->
exifMsg( $tag, $val );
223 $val = $this->
exifMsg( $tag, $val );
231 case 'PlanarConfiguration':
235 $val = $this->
exifMsg( $tag, $val );
244 case 'YCbCrPositioning':
248 $val = $this->
exifMsg( $tag, $val );
258 switch ( $resolutionunit ) {
273 case 'FlashpixVersion':
281 $val = $this->
exifMsg( $tag, $val );
289 case 'ComponentsConfiguration':
298 $val = $this->
exifMsg( $tag, $val );
307 case 'DateTimeOriginal':
308 case 'DateTimeDigitized':
309 case 'DateTimeReleased':
310 case 'DateTimeExpires':
313 case 'DateTimeMetadata':
314 if ( $val ==
'0000:00:00 00:00:00' || $val ==
' : : : : ' ) {
315 $val = $this->
msg(
'exif-unknowndate' )->text();
316 } elseif ( preg_match(
317 '/^(?:\d{4}):(?:\d\d):(?:\d\d) (?:\d\d):(?:\d\d):(?:\d\d)$/D',
325 } elseif ( preg_match(
'/^(?:\d{4}):(?:\d\d):(?:\d\d) (?:\d\d):(?:\d\d)$/D', $val ) ) {
333 } elseif ( preg_match(
'/^(?:\d{4}):(?:\d\d):(?:\d\d)$/D', $val ) ) {
336 . substr( $val, 5, 2 )
337 . substr( $val, 8, 2 )
346 case 'ExposureProgram':
357 $val = $this->
exifMsg( $tag, $val );
365 case 'SubjectDistance':
380 $val = $this->
exifMsg( $tag, $val );
411 $val = $this->
exifMsg( $tag, $val );
421 'fired' => $val & 0b00000001,
422 'return' => ( $val & 0b00000110 ) >> 1,
423 'mode' => ( $val & 0b00011000 ) >> 3,
424 'function' => ( $val & 0b00100000 ) >> 5,
425 'redeye' => ( $val & 0b01000000 ) >> 6,
429 # We do not need to handle unknown values since all are used.
430 foreach ( $flashDecode
as $subTag => $subValue ) {
431 # We do not need any message for zeroed values.
432 if ( $subTag !=
'fired' && $subValue == 0 ) {
435 $fullTag = $tag .
'-' . $subTag;
436 $flashMsgs[] = $this->
exifMsg( $fullTag, $subValue );
438 $val = $this->
getLanguage()->commaList( $flashMsgs );
441 case 'FocalPlaneResolutionUnit':
444 $val = $this->
exifMsg( $tag, $val );
452 case 'SensingMethod':
461 $val = $this->
exifMsg( $tag, $val );
472 $val = $this->
exifMsg( $tag, $val );
483 $val = $this->
exifMsg( $tag, $val );
491 case 'CustomRendered':
495 $val = $this->
exifMsg( $tag, $val );
508 $val = $this->
exifMsg( $tag, $val );
520 $val = $this->
exifMsg( $tag, $val );
528 case 'SceneCaptureType':
534 $val = $this->
exifMsg( $tag, $val );
549 $val = $this->
exifMsg( $tag, $val );
562 $val = $this->
exifMsg( $tag, $val );
575 $val = $this->
exifMsg( $tag, $val );
588 $val = $this->
exifMsg( $tag, $val );
596 case 'SubjectDistanceRange':
602 $val = $this->
exifMsg( $tag, $val );
611 case 'GPSLatitudeRef':
612 case 'GPSDestLatitudeRef':
616 $val = $this->
exifMsg(
'GPSLatitude', $val );
624 case 'GPSLongitudeRef':
625 case 'GPSDestLongitudeRef':
629 $val = $this->
exifMsg(
'GPSLongitude', $val );
639 $val = $this->
exifMsg(
'GPSAltitude',
'below-sealevel', $this->
formatNum( -$val, 3 ) );
641 $val = $this->
exifMsg(
'GPSAltitude',
'above-sealevel', $this->
formatNum( $val, 3 ) );
649 $val = $this->
exifMsg( $tag, $val );
657 case 'GPSMeasureMode':
661 $val = $this->
exifMsg( $tag, $val );
670 case 'GPSImgDirectionRef':
671 case 'GPSDestBearingRef':
675 $val = $this->
exifMsg(
'GPSDirection', $val );
684 case 'GPSDestLatitude':
688 case 'GPSDestLongitude':
697 $val = $this->
exifMsg(
'GPSSpeed', $val );
705 case 'GPSDestDistanceRef':
710 $val = $this->
exifMsg(
'GPSDestDistance', $val );
722 } elseif ( $val <= 5 ) {
724 } elseif ( $val <= 10 ) {
726 } elseif ( $val <= 20 ) {
738 $val = $this->
exifMsg( $tag,
'', $val );
742 if ( is_array( $val ) ) {
743 if (
count( $val ) > 1 ) {
745 $val = $this->
msg(
'exif-software-version-value', $val[0], $val[1] )->text();
748 $val = $this->
exifMsg( $tag,
'', $val[0] );
751 $val = $this->
exifMsg( $tag,
'', $val );
757 $val = $this->
msg(
'exif-exposuretime-format',
760 case 'ISOSpeedRatings':
764 if ( $val ==
'65535' ) {
765 $val = $this->
exifMsg( $tag,
'overflow' );
771 $val = $this->
msg(
'exif-fnumber-format',
776 case 'FocalLengthIn35mmFilm':
777 $val = $this->
msg(
'exif-focallength-format',
781 case 'MaxApertureValue':
782 if ( strpos( $val,
'/' ) !==
false ) {
784 list( $n, $d ) = explode(
'/', $val );
785 if ( is_numeric( $n ) && is_numeric( $d ) ) {
789 if ( is_numeric( $val ) ) {
790 $fNumber = pow( 2, $val / 2 );
791 if ( $fNumber !==
false ) {
792 $val = $this->
msg(
'exif-maxaperturevalue-value',
801 switch ( strtolower( $val ) ) {
827 case 'SubjectNewsCode':
839 if ( $val == 0 || $val == 9 ) {
841 } elseif ( $val < 5 && $val > 1 ) {
843 } elseif ( $val == 5 ) {
845 } elseif ( $val <= 8 && $val > 5 ) {
849 if ( $urgency !==
'' ) {
850 $val = $this->
exifMsg(
'urgency',
857 case 'OriginalImageHeight':
858 case 'OriginalImageWidth':
859 case 'PixelXDimension':
860 case 'PixelYDimension':
863 $val = $this->
formatNum( $val ) .
' ' . $this->
msg(
'unit-pixel' )->text();
873 case 'ImageDescription':
877 case 'RelatedSoundFile':
878 case 'ImageUniqueID':
879 case 'SpectralSensitivity':
880 case 'GPSSatellites':
884 case 'WorldRegionDest':
886 case 'CountryCodeDest':
887 case 'ProvinceOrStateDest':
889 case 'SublocationDest':
890 case 'WorldRegionCreated':
891 case 'CountryCreated':
892 case 'CountryCodeCreated':
893 case 'ProvinceOrStateCreated':
895 case 'SublocationCreated':
897 case 'SpecialInstructions':
902 case 'FixtureIdentifier':
904 case 'LocationDestCode':
906 case 'JPEGFileComment':
907 case 'iimSupplementalCategory':
908 case 'OriginalTransmissionRef':
910 case 'dc-contributor':
919 case 'CameraOwnerName':
922 case 'RightsCertificate':
923 case 'CopyrightOwner':
926 case 'OriginalDocumentID':
928 case 'MorePermissionsUrl':
929 case 'AttributionUrl':
930 case 'PreferredAttributionName':
931 case 'PNGFileComment':
933 case 'ContentWarning':
934 case 'GIFFileComment':
936 case 'IntellectualGenre':
938 case 'OrginisationInImage':
939 case 'PersonInImage':
941 $val = htmlspecialchars( $val );
949 $val = $this->
exifMsg( $tag, $val );
952 $val = htmlspecialchars( $val );
960 $val = $this->
exifMsg( $tag, $val );
965 if ( $val ==
'-1' ) {
966 $val = $this->
exifMsg( $tag,
'rejected' );
975 $val = htmlspecialchars(
$lang );
977 $val = htmlspecialchars( $val );
1019 return $obj->flattenArrayReal( $vals,
$type, $noHtml );
1039 if ( !is_array( $vals ) ) {
1043 if ( isset( $vals[
'_type'] ) ) {
1044 $type = $vals[
'_type'];
1045 unset( $vals[
'_type'] );
1048 if ( !is_array( $vals ) ) {
1050 } elseif (
count( $vals ) === 1 &&
$type !==
'lang' && isset( $vals[0] ) ) {
1052 } elseif (
count( $vals ) === 0 ) {
1053 wfDebug( __METHOD__ .
" metadata array with 0 elements!\n" );
1072 $defaultItem =
false;
1073 $defaultLang =
false;
1082 if ( isset( $vals[
'x-default'] ) ) {
1083 $defaultItem = $vals[
'x-default'];
1084 unset( $vals[
'x-default'] );
1086 foreach ( $priorityLanguages
as $pLang ) {
1087 if ( isset( $vals[$pLang] ) ) {
1089 if ( $vals[$pLang] === $defaultItem ) {
1090 $defaultItem =
false;
1094 $vals[$pLang], $pLang,
1095 $isDefault, $noHtml );
1097 unset( $vals[$pLang] );
1099 if ( $this->singleLang ) {
1101 [
'lang' => $pLang ], $vals[$pLang] );
1107 foreach ( $vals
as $lang => $item ) {
1108 if ( $item === $defaultItem ) {
1109 $defaultLang =
$lang;
1112 $content .= $this->
langItem( $item,
1113 $lang,
false, $noHtml );
1114 if ( $this->singleLang ) {
1116 [
'lang' =>
$lang ], $item );
1119 if ( $defaultItem !==
false ) {
1120 $content = $this->
langItem( $defaultItem,
1121 $defaultLang,
true, $noHtml ) .
1123 if ( $this->singleLang ) {
1124 return $defaultItem;
1131 return '<ul class="metadata-langlist">' .
1136 return "\n#" . implode(
"\n#", $vals );
1139 return "<ol><li>" . implode(
"</li>\n<li>", $vals ) .
'</li></ol>';
1143 return "\n*" . implode(
"\n*", $vals );
1146 return "<ul><li>" . implode(
"</li>\n<li>", $vals ) .
'</li></ul>';
1162 if (
$lang ===
false && $default ===
false ) {
1163 throw new MWException(
'$lang and $default cannot both '
1170 $wrappedValue =
'<span class="mw-metadata-lang-value">'
1174 if (
$lang ===
false ) {
1175 $msg = $this->
msg(
'metadata-langitem-default', $wrappedValue );
1177 return $msg->text() .
"\n\n";
1180 return '<li class="mw-metadata-lang-default">'
1185 $lowLang = strtolower(
$lang );
1187 if ( $langName ===
'' ) {
1189 list( $langPrefix ) = explode(
'-', $lowLang, 2 );
1191 if ( $langName ===
'' ) {
1198 $msg = $this->
msg(
'metadata-langitem', $wrappedValue, $langName,
$lang );
1200 return '*' . $msg->text();
1203 $item =
'<li class="mw-metadata-lang-code-'
1206 $item .=
' mw-metadata-lang-default';
1208 $item .=
'" lang="' .
$lang .
'">';
1209 $item .= $msg->text();
1224 private function exifMsg( $tag, $val, $arg =
null, $arg2 =
null ) {
1227 if ( $val ===
'' ) {
1231 return $this->
msg( $wgContLang->lc(
"exif-$tag-$val" ), $arg, $arg2 )->
text();
1244 if ( is_array( $num ) ) {
1246 foreach ( $num
as $number ) {
1252 if ( preg_match(
'/^(-?\d+)\/(\d+)$/', $num, $m ) ) {
1254 $newNum = $m[1] / $m[2];
1255 if ( $round !==
false ) {
1256 $newNum = round( $newNum, $round );
1262 return $this->
getLanguage()->formatNum( $newNum );
1264 if ( is_numeric( $num ) && $round !==
false ) {
1265 $num = round( $num, $round );
1280 if ( preg_match(
'/^(-?\d+)\/(\d+)$/', $num, $m ) ) {
1281 $numerator = intval( $m[1] );
1282 $denominator = intval( $m[2] );
1283 $gcd = $this->
gcd( abs( $numerator ), $denominator );
1286 return $this->
formatNum( $numerator / $gcd ) .
'/' . $this->
formatNum( $denominator / $gcd );
1300 private function gcd( $a, $b ) {
1310 $remainder = $a % $b;
1333 if ( !preg_match(
'/^\d{8}$/D', $val ) ) {
1338 switch ( substr( $val, 0, 2 ) ) {
1391 if ( $cat !==
'' ) {
1392 $catMsg = $this->
exifMsg(
'iimcategory', $cat );
1393 $val = $this->
exifMsg(
'subjectnewscode',
'', $val, $catMsg );
1411 if (
$type ===
'latitude' ) {
1413 } elseif (
$type ===
'longitude' ) {
1418 if (
$type ===
'latitude' ) {
1420 } elseif (
$type ===
'longitude' ) {
1425 $deg = floor( $nCoord );
1426 $min = floor( ( $nCoord - $deg ) * 60.0 );
1427 $sec = round( ( ( $nCoord - $deg ) - $min / 60 ) * 3600, 2 );
1433 return $this->
msg(
'exif-coordinate-format', $deg, $min, $sec, $ref, $coord )->text();
1451 if ( !( isset( $vals[
'CiAdrExtadr'] )
1452 || isset( $vals[
'CiAdrCity'] )
1453 || isset( $vals[
'CiAdrCtry'] )
1454 || isset( $vals[
'CiEmailWork'] )
1455 || isset( $vals[
'CiTelWork'] )
1456 || isset( $vals[
'CiAdrPcode'] )
1457 || isset( $vals[
'CiAdrRegion'] )
1458 || isset( $vals[
'CiUrlWork'] )
1469 foreach ( $vals
as &$val ) {
1470 $val = htmlspecialchars( $val );
1478 $url = $tel = $street = $city = $country =
'';
1479 $email = $postal = $region =
'';
1488 if ( isset( $vals[
'CiAdrExtadr'] ) ) {
1491 $street =
'<span class="extended-address">'
1493 $vals[
'CiAdrExtadr'] )
1496 if ( isset( $vals[
'CiAdrCity'] ) ) {
1497 $city =
'<span class="locality">'
1498 . htmlspecialchars( $vals[
'CiAdrCity'] )
1501 if ( isset( $vals[
'CiAdrCtry'] ) ) {
1502 $country =
'<span class="country-name">'
1503 . htmlspecialchars( $vals[
'CiAdrCtry'] )
1506 if ( isset( $vals[
'CiEmailWork'] ) ) {
1509 $splitEmails = explode(
"\n", $vals[
'CiEmailWork'] );
1510 foreach ( $splitEmails
as $e1 ) {
1512 foreach ( explode(
',', $e1 )
as $e2 ) {
1513 $finalEmail = trim( $e2 );
1514 if ( $finalEmail ==
',' || $finalEmail ==
'' ) {
1517 if ( strpos( $finalEmail,
'<' ) !==
false ) {
1520 $emails[] = $finalEmail;
1522 $emails[] =
'[mailto:'
1524 .
' <span class="email">'
1530 $email = implode(
', ', $emails );
1532 if ( isset( $vals[
'CiTelWork'] ) ) {
1533 $tel =
'<span class="tel">'
1534 . htmlspecialchars( $vals[
'CiTelWork'] )
1537 if ( isset( $vals[
'CiAdrPcode'] ) ) {
1538 $postal =
'<span class="postal-code">'
1540 $vals[
'CiAdrPcode'] )
1543 if ( isset( $vals[
'CiAdrRegion'] ) ) {
1545 $region =
'<span class="region">'
1547 $vals[
'CiAdrRegion'] )
1550 if ( isset( $vals[
'CiUrlWork'] ) ) {
1551 $url =
'<span class="url">'
1552 . htmlspecialchars( $vals[
'CiUrlWork'] )
1556 return $this->
msg(
'exif-contact-value', $email, $url,
1557 $street, $city, $region, $postal, $country,
1573 if ( preg_match(
'/^\\*\s*(.*?)\s*$/',
$line,
$matches ) ) {
1577 $fields = array_map(
'strtolower', $fields );
1590 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1597 $cacheKey =
$cache->makeKey(
1598 'getExtendedMetadata',
1600 (
int)$this->singleLang,
1604 $cachedValue =
$cache->get( $cacheKey );
1607 &&
Hooks::run(
'ValidateExtendedMetadataCache', [ $cachedValue[
'timestamp'], $file ] )
1609 $extendedMetadata = $cachedValue[
'data'];
1611 $maxCacheTime = ( $file instanceof
ForeignAPIFile ) ? 60 * 60 * 12 : 60 * 60 * 24 * 30;
1614 if ( $this->singleLang ) {
1623 $valueToCache = [
'data' => $extendedMetadata,
'timestamp' =>
wfTimestampNow() ];
1624 $cache->set( $cacheKey, $valueToCache, $maxCacheTime );
1627 return $extendedMetadata;
1645 return $file->getExtendedMetadata() ?: [];
1653 'value' => $uploadDate,
1654 'source' =>
'mediawiki-metadata',
1660 $text =
$title->getText();
1661 $pos = strrpos( $text,
'.' );
1664 $name = substr( $text, 0, $pos );
1669 $fileMetadata[
'ObjectName'] = [
1671 'source' =>
'mediawiki-metadata',
1675 return $fileMetadata;
1699 $visible = array_flip( self::getVisibleFields() );
1700 foreach ( $extendedMetadata
as $key =>
$value ) {
1701 if ( !isset( $visible[strtolower( $key )] ) ) {
1702 $extendedMetadata[$key][
'hidden'] =
'';
1706 return $extendedMetadata;
1720 || !isset(
$value[
'_type'] )
1721 ||
$value[
'_type'] !=
'lang'
1728 foreach ( $priorityLanguages
as $lang ) {
1735 if ( isset(
$value[
'x-default'] ) ) {
1736 return $value[
'x-default'];
1740 unset(
$value[
'_type'] );
1741 if ( !empty(
$value ) ) {
1759 if ( !is_array(
$value ) ) {
1761 } elseif ( isset(
$value[
'_type'] ) &&
$value[
'_type'] ===
'lang' ) {
1784 if ( !is_array( $metadata ) ) {
1787 foreach ( $metadata
as &$field ) {
1788 if ( isset( $field[
'value'] ) ) {
1801 if ( !is_array( $metadata ) ) {
1804 foreach ( $metadata
as $key => &$field ) {
1805 if ( $key ===
'Software' || $key ===
'Contact' ) {
1810 if ( isset( $field[
'value'] ) ) {
1821 if ( !is_array( $arr ) ) {
1826 foreach ( $arr
as $key => &
$value ) {
1828 if ( $sanitizedKey !== $key ) {
1829 if ( isset( $arr[$sanitizedKey] ) ) {
1834 $sanitizedKey .= $counter;
1837 $arr[$sanitizedKey] = $arr[$key];
1838 unset( $arr[$key] );
1840 if ( is_array(
$value ) ) {
1846 $keys = array_filter( array_keys( $arr ),
'ApiResult::isMetadataKey' );
1862 $key = preg_replace(
'/[^a-zA-z0-9_:.-]/',
'', $key );
1864 $key = preg_replace(
'/^[\d-.]+/',
'', $key );
1871 if ( $key ==
'_element' ) {
1885 $priorityLanguages =
1887 $priorityLanguages = array_merge(
1889 $priorityLanguages[0],
1890 $priorityLanguages[1]
1893 return $priorityLanguages;
getContext()
Get the base IContextSource object.
if(!isset( $args[0])) $lang
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
getTimestamp()
Get the 14-character timestamp of the file upload.
getSha1()
Get the SHA-1 base 36 hash of the file.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Allows to change the fields on the form that will be generated $name
isDeleted( $field)
Is this file a "deleted" file in a private archive? STUB.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database key
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...
namespace and then decline to actually register it file or subcat img or subcat $title
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
see documentation in includes Linker php for Linker::makeImageLink & $time
when a variable name is used in a it is silently declared as a new masking the global
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
setContext(IContextSource $context)
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
static fetchLanguageName( $code, $inLanguage=null, $include='all')
getTitle()
Return the associated title object.
static setPreserveKeysList(array &$arr, $names)
Preserve specified keys.
static getFallbacksIncludingSiteLanguage( $code)
Get the ordered list of fallback languages, ending with the fallback language chain for the site lang...
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
Foreign file accessible through api.php requests.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out