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 ) ) {
744 $val = $this->
msg(
'exif-software-version-value', $val[0], $val[1] )->text();
746 $val = $this->
exifMsg( $tag,
'', $val );
752 $val = $this->
msg(
'exif-exposuretime-format',
755 case 'ISOSpeedRatings':
759 if ( $val ==
'65535' ) {
760 $val = $this->
exifMsg( $tag,
'overflow' );
766 $val = $this->
msg(
'exif-fnumber-format',
771 case 'FocalLengthIn35mmFilm':
772 $val = $this->
msg(
'exif-focallength-format',
776 case 'MaxApertureValue':
777 if ( strpos( $val,
'/' ) !==
false ) {
779 list( $n, $d ) = explode(
'/', $val );
780 if ( is_numeric( $n ) && is_numeric( $d ) ) {
784 if ( is_numeric( $val ) ) {
785 $fNumber = pow( 2, $val / 2 );
786 if ( $fNumber !==
false ) {
787 $val = $this->
msg(
'exif-maxaperturevalue-value',
796 switch ( strtolower( $val ) ) {
822 case 'SubjectNewsCode':
834 if ( $val == 0 || $val == 9 ) {
836 } elseif ( $val < 5 && $val > 1 ) {
838 } elseif ( $val == 5 ) {
840 } elseif ( $val <= 8 && $val > 5 ) {
844 if ( $urgency !==
'' ) {
845 $val = $this->
exifMsg(
'urgency',
852 case 'OriginalImageHeight':
853 case 'OriginalImageWidth':
854 case 'PixelXDimension':
855 case 'PixelYDimension':
858 $val = $this->
formatNum( $val ) .
' ' . $this->
msg(
'unit-pixel' )->text();
868 case 'ImageDescription':
872 case 'RelatedSoundFile':
873 case 'ImageUniqueID':
874 case 'SpectralSensitivity':
875 case 'GPSSatellites':
879 case 'WorldRegionDest':
881 case 'CountryCodeDest':
882 case 'ProvinceOrStateDest':
884 case 'SublocationDest':
885 case 'WorldRegionCreated':
886 case 'CountryCreated':
887 case 'CountryCodeCreated':
888 case 'ProvinceOrStateCreated':
890 case 'SublocationCreated':
892 case 'SpecialInstructions':
897 case 'FixtureIdentifier':
899 case 'LocationDestCode':
901 case 'JPEGFileComment':
902 case 'iimSupplementalCategory':
903 case 'OriginalTransmissionRef':
905 case 'dc-contributor':
914 case 'CameraOwnerName':
917 case 'RightsCertificate':
918 case 'CopyrightOwner':
921 case 'OriginalDocumentID':
923 case 'MorePermissionsUrl':
924 case 'AttributionUrl':
925 case 'PreferredAttributionName':
926 case 'PNGFileComment':
928 case 'ContentWarning':
929 case 'GIFFileComment':
931 case 'IntellectualGenre':
933 case 'OrginisationInImage':
934 case 'PersonInImage':
936 $val = htmlspecialchars( $val );
944 $val = $this->
exifMsg( $tag, $val );
947 $val = htmlspecialchars( $val );
955 $val = $this->
exifMsg( $tag, $val );
960 if ( $val ==
'-1' ) {
961 $val = $this->
exifMsg( $tag,
'rejected' );
970 $val = htmlspecialchars(
$lang );
972 $val = htmlspecialchars( $val );
1014 return $obj->flattenArrayReal( $vals,
$type, $noHtml );
1034 if ( !is_array( $vals ) ) {
1038 if ( isset( $vals[
'_type'] ) ) {
1039 $type = $vals[
'_type'];
1040 unset( $vals[
'_type'] );
1043 if ( !is_array( $vals ) ) {
1045 } elseif (
count( $vals ) === 1 &&
$type !==
'lang' ) {
1047 } elseif (
count( $vals ) === 0 ) {
1048 wfDebug( __METHOD__ .
" metadata array with 0 elements!\n" );
1067 $defaultItem =
false;
1068 $defaultLang =
false;
1077 if ( isset( $vals[
'x-default'] ) ) {
1078 $defaultItem = $vals[
'x-default'];
1079 unset( $vals[
'x-default'] );
1081 foreach ( $priorityLanguages
as $pLang ) {
1082 if ( isset( $vals[$pLang] ) ) {
1084 if ( $vals[$pLang] === $defaultItem ) {
1085 $defaultItem =
false;
1089 $vals[$pLang], $pLang,
1090 $isDefault, $noHtml );
1092 unset( $vals[$pLang] );
1094 if ( $this->singleLang ) {
1096 [
'lang' => $pLang ], $vals[$pLang] );
1102 foreach ( $vals
as $lang => $item ) {
1103 if ( $item === $defaultItem ) {
1104 $defaultLang =
$lang;
1107 $content .= $this->
langItem( $item,
1108 $lang,
false, $noHtml );
1109 if ( $this->singleLang ) {
1111 [
'lang' =>
$lang ], $item );
1114 if ( $defaultItem !==
false ) {
1115 $content = $this->
langItem( $defaultItem,
1116 $defaultLang,
true, $noHtml ) .
1118 if ( $this->singleLang ) {
1119 return $defaultItem;
1126 return '<ul class="metadata-langlist">' .
1131 return "\n#" . implode(
"\n#", $vals );
1134 return "<ol><li>" . implode(
"</li>\n<li>", $vals ) .
'</li></ol>';
1138 return "\n*" . implode(
"\n*", $vals );
1141 return "<ul><li>" . implode(
"</li>\n<li>", $vals ) .
'</li></ul>';
1157 if (
$lang ===
false && $default ===
false ) {
1158 throw new MWException(
'$lang and $default cannot both '
1165 $wrappedValue =
'<span class="mw-metadata-lang-value">'
1169 if (
$lang ===
false ) {
1170 $msg = $this->
msg(
'metadata-langitem-default', $wrappedValue );
1172 return $msg->text() .
"\n\n";
1175 return '<li class="mw-metadata-lang-default">'
1180 $lowLang = strtolower(
$lang );
1182 if ( $langName ===
'' ) {
1184 list( $langPrefix ) = explode(
'-', $lowLang, 2 );
1186 if ( $langName ===
'' ) {
1193 $msg = $this->
msg(
'metadata-langitem', $wrappedValue, $langName,
$lang );
1195 return '*' . $msg->text();
1198 $item =
'<li class="mw-metadata-lang-code-'
1201 $item .=
' mw-metadata-lang-default';
1203 $item .=
'" lang="' .
$lang .
'">';
1204 $item .= $msg->text();
1219 private function exifMsg( $tag, $val, $arg =
null, $arg2 =
null ) {
1222 if ( $val ===
'' ) {
1226 return $this->
msg( $wgContLang->lc(
"exif-$tag-$val" ), $arg, $arg2 )->
text();
1239 if ( is_array( $num ) ) {
1241 foreach ( $num
as $number ) {
1247 if ( preg_match(
'/^(-?\d+)\/(\d+)$/', $num, $m ) ) {
1249 $newNum = $m[1] / $m[2];
1250 if ( $round !==
false ) {
1251 $newNum = round( $newNum, $round );
1257 return $this->
getLanguage()->formatNum( $newNum );
1259 if ( is_numeric( $num ) && $round !==
false ) {
1260 $num = round( $num, $round );
1275 if ( preg_match(
'/^(-?\d+)\/(\d+)$/', $num, $m ) ) {
1276 $numerator = intval( $m[1] );
1277 $denominator = intval( $m[2] );
1278 $gcd = $this->
gcd( abs( $numerator ), $denominator );
1281 return $this->
formatNum( $numerator / $gcd ) .
'/' . $this->
formatNum( $denominator / $gcd );
1295 private function gcd( $a, $b ) {
1305 $remainder = $a % $b;
1328 if ( !preg_match(
'/^\d{8}$/D', $val ) ) {
1333 switch ( substr( $val, 0, 2 ) ) {
1386 if ( $cat !==
'' ) {
1387 $catMsg = $this->
exifMsg(
'iimcategory', $cat );
1388 $val = $this->
exifMsg(
'subjectnewscode',
'', $val, $catMsg );
1406 if (
$type ===
'latitude' ) {
1408 } elseif (
$type ===
'longitude' ) {
1413 if (
$type ===
'latitude' ) {
1415 } elseif (
$type ===
'longitude' ) {
1420 $deg = floor( $nCoord );
1421 $min = floor( ( $nCoord - $deg ) * 60.0 );
1422 $sec = round( ( ( $nCoord - $deg ) - $min / 60 ) * 3600, 2 );
1428 return $this->
msg(
'exif-coordinate-format', $deg, $min, $sec, $ref, $coord )->text();
1446 if ( !( isset( $vals[
'CiAdrExtadr'] )
1447 || isset( $vals[
'CiAdrCity'] )
1448 || isset( $vals[
'CiAdrCtry'] )
1449 || isset( $vals[
'CiEmailWork'] )
1450 || isset( $vals[
'CiTelWork'] )
1451 || isset( $vals[
'CiAdrPcode'] )
1452 || isset( $vals[
'CiAdrRegion'] )
1453 || isset( $vals[
'CiUrlWork'] )
1464 foreach ( $vals
as &$val ) {
1465 $val = htmlspecialchars( $val );
1473 $url = $tel = $street = $city = $country =
'';
1474 $email = $postal = $region =
'';
1483 if ( isset( $vals[
'CiAdrExtadr'] ) ) {
1486 $street =
'<span class="extended-address">'
1488 $vals[
'CiAdrExtadr'] )
1491 if ( isset( $vals[
'CiAdrCity'] ) ) {
1492 $city =
'<span class="locality">'
1493 . htmlspecialchars( $vals[
'CiAdrCity'] )
1496 if ( isset( $vals[
'CiAdrCtry'] ) ) {
1497 $country =
'<span class="country-name">'
1498 . htmlspecialchars( $vals[
'CiAdrCtry'] )
1501 if ( isset( $vals[
'CiEmailWork'] ) ) {
1504 $splitEmails = explode(
"\n", $vals[
'CiEmailWork'] );
1505 foreach ( $splitEmails
as $e1 ) {
1507 foreach ( explode(
',', $e1 )
as $e2 ) {
1508 $finalEmail = trim( $e2 );
1509 if ( $finalEmail ==
',' || $finalEmail ==
'' ) {
1512 if ( strpos( $finalEmail,
'<' ) !==
false ) {
1515 $emails[] = $finalEmail;
1517 $emails[] =
'[mailto:'
1519 .
' <span class="email">'
1525 $email = implode(
', ', $emails );
1527 if ( isset( $vals[
'CiTelWork'] ) ) {
1528 $tel =
'<span class="tel">'
1529 . htmlspecialchars( $vals[
'CiTelWork'] )
1532 if ( isset( $vals[
'CiAdrPcode'] ) ) {
1533 $postal =
'<span class="postal-code">'
1535 $vals[
'CiAdrPcode'] )
1538 if ( isset( $vals[
'CiAdrRegion'] ) ) {
1540 $region =
'<span class="region">'
1542 $vals[
'CiAdrRegion'] )
1545 if ( isset( $vals[
'CiUrlWork'] ) ) {
1546 $url =
'<span class="url">'
1547 . htmlspecialchars( $vals[
'CiUrlWork'] )
1551 return $this->
msg(
'exif-contact-value', $email, $url,
1552 $street, $city, $region, $postal, $country,
1568 if ( preg_match(
'/^\\*\s*(.*?)\s*$/',
$line,
$matches ) ) {
1572 $fields = array_map(
'strtolower', $fields );
1585 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1592 $cacheKey =
$cache->makeKey(
1593 'getExtendedMetadata',
1595 (
int)$this->singleLang,
1599 $cachedValue =
$cache->get( $cacheKey );
1602 &&
Hooks::run(
'ValidateExtendedMetadataCache', [ $cachedValue[
'timestamp'], $file ] )
1604 $extendedMetadata = $cachedValue[
'data'];
1606 $maxCacheTime = ( $file instanceof
ForeignAPIFile ) ? 60 * 60 * 12 : 60 * 60 * 24 * 30;
1609 if ( $this->singleLang ) {
1618 $valueToCache = [
'data' => $extendedMetadata,
'timestamp' =>
wfTimestampNow() ];
1619 $cache->set( $cacheKey, $valueToCache, $maxCacheTime );
1622 return $extendedMetadata;
1640 return $file->getExtendedMetadata() ?: [];
1648 'value' => $uploadDate,
1649 'source' =>
'mediawiki-metadata',
1655 $text =
$title->getText();
1656 $pos = strrpos( $text,
'.' );
1659 $name = substr( $text, 0, $pos );
1664 $fileMetadata[
'ObjectName'] = [
1666 'source' =>
'mediawiki-metadata',
1670 return $fileMetadata;
1694 $visible = array_flip( self::getVisibleFields() );
1695 foreach ( $extendedMetadata
as $key =>
$value ) {
1696 if ( !isset( $visible[strtolower( $key )] ) ) {
1697 $extendedMetadata[$key][
'hidden'] =
'';
1701 return $extendedMetadata;
1715 || !isset(
$value[
'_type'] )
1716 ||
$value[
'_type'] !=
'lang'
1723 foreach ( $priorityLanguages
as $lang ) {
1730 if ( isset(
$value[
'x-default'] ) ) {
1731 return $value[
'x-default'];
1735 unset(
$value[
'_type'] );
1736 if ( !empty(
$value ) ) {
1754 if ( !is_array(
$value ) ) {
1756 } elseif ( isset(
$value[
'_type'] ) &&
$value[
'_type'] ===
'lang' ) {
1765 if ( $k ===
'_type' ) {
1779 if ( !is_array( $metadata ) ) {
1782 foreach ( $metadata
as &$field ) {
1783 if ( isset( $field[
'value'] ) ) {
1796 if ( !is_array( $metadata ) ) {
1799 foreach ( $metadata
as $key => &$field ) {
1800 if ( $key ===
'Software' || $key ===
'Contact' ) {
1805 if ( isset( $field[
'value'] ) ) {
1816 if ( !is_array( $arr ) ) {
1821 foreach ( $arr
as $key => &
$value ) {
1823 if ( $sanitizedKey !== $key ) {
1824 if ( isset( $arr[$sanitizedKey] ) ) {
1829 $sanitizedKey .= $counter;
1832 $arr[$sanitizedKey] = $arr[$key];
1833 unset( $arr[$key] );
1835 if ( is_array(
$value ) ) {
1841 $keys = array_filter( array_keys( $arr ),
'ApiResult::isMetadataKey' );
1857 $key = preg_replace(
'/[^a-zA-z0-9_:.-]/',
'', $key );
1859 $key = preg_replace(
'/^[\d-.]+/',
'', $key );
1866 if ( $key ==
'_element' ) {
1880 $priorityLanguages =
1882 $priorityLanguages = array_merge(
1884 $priorityLanguages[0],
1885 $priorityLanguages[1]
1888 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
getLanguage()
Get the Language object.
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)
Set the IContextSource object.
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