64 $this->singleLang = $val;
86 return $obj->makeFormattedData( $tags );
101 $resolutionunit = !isset( $tags[
'ResolutionUnit'] ) || $tags[
'ResolutionUnit'] == 2 ? 2 : 3;
102 unset( $tags[
'ResolutionUnit'] );
104 foreach ( $tags
as $tag => &$vals ) {
108 if ( !is_array( $tags[
$tag] ) ) {
113 if ( isset( $tags[$tag][
'_type'] ) ) {
115 unset( $vals[
'_type'] );
121 if ( $tag ==
'GPSTimeStamp' && count( $vals ) === 3 ) {
124 $h = explode(
'/', $vals[0] );
125 $m = explode(
'/', $vals[1] );
126 $s = explode(
'/', $vals[2] );
141 $tags[
$tag] = str_pad( intval( $h[0] / $h[1] ), 2,
'0', STR_PAD_LEFT )
142 .
':' . str_pad( intval( $m[0] / $m[1] ), 2,
'0', STR_PAD_LEFT )
143 .
':' . str_pad( intval(
$s[0] /
$s[1] ), 2,
'0', STR_PAD_LEFT );
162 if ( $tag ===
'Contact' ) {
167 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':
871 case 'RelatedSoundFile':
872 case 'ImageUniqueID':
873 case 'SpectralSensitivity':
874 case 'GPSSatellites':
878 case 'WorldRegionDest':
880 case 'CountryCodeDest':
881 case 'ProvinceOrStateDest':
883 case 'SublocationDest':
884 case 'WorldRegionCreated':
885 case 'CountryCreated':
886 case 'CountryCodeCreated':
887 case 'ProvinceOrStateCreated':
889 case 'SublocationCreated':
891 case 'SpecialInstructions':
896 case 'FixtureIdentifier':
898 case 'LocationDestCode':
900 case 'JPEGFileComment':
901 case 'iimSupplementalCategory':
902 case 'OriginalTransmissionRef':
904 case 'dc-contributor':
913 case 'CameraOwnerName':
916 case 'RightsCertificate':
917 case 'CopyrightOwner':
920 case 'OriginalDocumentID':
922 case 'MorePermissionsUrl':
923 case 'AttributionUrl':
924 case 'PreferredAttributionName':
925 case 'PNGFileComment':
927 case 'ContentWarning':
928 case 'GIFFileComment':
930 case 'IntellectualGenre':
932 case 'OrginisationInImage':
933 case 'PersonInImage':
935 $val = htmlspecialchars( $val );
943 $val = $this->
exifMsg( $tag, $val );
946 $val = htmlspecialchars( $val );
954 $val = $this->
exifMsg( $tag, $val );
959 if ( $val ==
'-1' ) {
960 $val = $this->
exifMsg( $tag,
'rejected' );
969 $val = htmlspecialchars(
$lang );
971 $val = htmlspecialchars( $val );
1010 $context->setLanguage( $wgContLang );
1013 return $obj->flattenArrayReal( $vals,
$type, $noHtml );
1033 if ( !is_array( $vals ) ) {
1037 if ( isset( $vals[
'_type'] ) ) {
1038 $type = $vals[
'_type'];
1039 unset( $vals[
'_type'] );
1042 if ( !is_array( $vals ) ) {
1044 } elseif ( count( $vals ) === 1 &&
$type !==
'lang' ) {
1046 } elseif ( count( $vals ) === 0 ) {
1047 wfDebug( __METHOD__ .
" metadata array with 0 elements!\n" );
1066 $defaultItem =
false;
1067 $defaultLang =
false;
1076 if ( isset( $vals[
'x-default'] ) ) {
1077 $defaultItem = $vals[
'x-default'];
1078 unset( $vals[
'x-default'] );
1080 foreach ( $priorityLanguages
as $pLang ) {
1081 if ( isset( $vals[$pLang] ) ) {
1083 if ( $vals[$pLang] === $defaultItem ) {
1084 $defaultItem =
false;
1088 $vals[$pLang], $pLang,
1089 $isDefault, $noHtml );
1091 unset( $vals[$pLang] );
1093 if ( $this->singleLang ) {
1095 [
'lang' => $pLang ], $vals[$pLang] );
1101 foreach ( $vals
as $lang => $item ) {
1102 if ( $item === $defaultItem ) {
1103 $defaultLang =
$lang;
1107 $lang,
false, $noHtml );
1108 if ( $this->singleLang ) {
1110 [
'lang' =>
$lang ], $item );
1113 if ( $defaultItem !==
false ) {
1115 $defaultLang,
true, $noHtml ) .
1117 if ( $this->singleLang ) {
1118 return $defaultItem;
1125 return '<ul class="metadata-langlist">' .
1130 return "\n#" . implode(
"\n#", $vals );
1133 return "<ol><li>" . implode(
"</li>\n<li>", $vals ) .
'</li></ol>';
1137 return "\n*" . implode(
"\n*", $vals );
1140 return "<ul><li>" . implode(
"</li>\n<li>", $vals ) .
'</li></ul>';
1156 if (
$lang ===
false && $default ===
false ) {
1157 throw new MWException(
'$lang and $default cannot both '
1164 $wrappedValue =
'<span class="mw-metadata-lang-value">'
1168 if (
$lang ===
false ) {
1169 $msg = $this->
msg(
'metadata-langitem-default', $wrappedValue );
1171 return $msg->text() .
"\n\n";
1174 return '<li class="mw-metadata-lang-default">'
1179 $lowLang = strtolower(
$lang );
1181 if ( $langName ===
'' ) {
1183 list( $langPrefix ) = explode(
'-', $lowLang, 2 );
1185 if ( $langName ===
'' ) {
1192 $msg = $this->
msg(
'metadata-langitem', $wrappedValue, $langName,
$lang );
1194 return '*' . $msg->text();
1197 $item =
'<li class="mw-metadata-lang-code-'
1200 $item .=
' mw-metadata-lang-default';
1202 $item .=
'" lang="' .
$lang .
'">';
1203 $item .= $msg->text();
1221 if ( $val ===
'' ) {
1225 return $this->
msg( $wgContLang->lc(
"exif-$tag-$val" ), $arg, $arg2 )->
text();
1238 if ( is_array( $num ) ) {
1240 foreach ( $num
as $number ) {
1246 if ( preg_match(
'/^(-?\d+)\/(\d+)$/', $num, $m ) ) {
1248 $newNum = $m[1] / $m[2];
1249 if ( $round !==
false ) {
1250 $newNum = round( $newNum, $round );
1256 return $this->
getLanguage()->formatNum( $newNum );
1258 if ( is_numeric( $num ) && $round !==
false ) {
1259 $num = round( $num, $round );
1274 if ( preg_match(
'/^(-?\d+)\/(\d+)$/', $num, $m ) ) {
1275 $numerator = intval( $m[1] );
1276 $denominator = intval( $m[2] );
1277 $gcd = $this->
gcd( abs( $numerator ), $denominator );
1280 return $this->
formatNum( $numerator / $gcd ) .
'/' . $this->
formatNum( $denominator / $gcd );
1294 private function gcd( $a, $b ) {
1304 $remainder = $a % $b;
1327 if ( !preg_match(
'/^\d{8}$/D', $val ) ) {
1332 switch ( substr( $val, 0, 2 ) ) {
1385 if ( $cat !==
'' ) {
1386 $catMsg = $this->
exifMsg(
'iimcategory', $cat );
1387 $val = $this->
exifMsg(
'subjectnewscode',
'', $val, $catMsg );
1405 if (
$type ===
'latitude' ) {
1407 } elseif (
$type ===
'longitude' ) {
1412 if (
$type ===
'latitude' ) {
1414 } elseif (
$type ===
'longitude' ) {
1419 $deg = floor( $nCoord );
1420 $min = floor( ( $nCoord - $deg ) * 60.0 );
1421 $sec = round( ( ( $nCoord - $deg ) - $min / 60 ) * 3600, 2 );
1427 return $this->
msg(
'exif-coordinate-format', $deg, $min, $sec, $ref, $coord )->text();
1445 if ( !( isset( $vals[
'CiAdrExtadr'] )
1446 || isset( $vals[
'CiAdrCity'] )
1447 || isset( $vals[
'CiAdrCtry'] )
1448 || isset( $vals[
'CiEmailWork'] )
1449 || isset( $vals[
'CiTelWork'] )
1450 || isset( $vals[
'CiAdrPcode'] )
1451 || isset( $vals[
'CiAdrRegion'] )
1452 || isset( $vals[
'CiUrlWork'] )
1463 foreach ( $vals
as &$val ) {
1464 $val = htmlspecialchars( $val );
1472 $url = $tel = $street = $city = $country =
'';
1473 $email = $postal = $region =
'';
1482 if ( isset( $vals[
'CiAdrExtadr'] ) ) {
1485 $street =
'<span class="extended-address">'
1487 $vals[
'CiAdrExtadr'] )
1490 if ( isset( $vals[
'CiAdrCity'] ) ) {
1491 $city =
'<span class="locality">'
1492 . htmlspecialchars( $vals[
'CiAdrCity'] )
1495 if ( isset( $vals[
'CiAdrCtry'] ) ) {
1496 $country =
'<span class="country-name">'
1497 . htmlspecialchars( $vals[
'CiAdrCtry'] )
1500 if ( isset( $vals[
'CiEmailWork'] ) ) {
1503 $splitEmails = explode(
"\n", $vals[
'CiEmailWork'] );
1504 foreach ( $splitEmails
as $e1 ) {
1506 foreach ( explode(
',', $e1 )
as $e2 ) {
1507 $finalEmail = trim( $e2 );
1508 if ( $finalEmail ==
',' || $finalEmail ==
'' ) {
1511 if ( strpos( $finalEmail,
'<' ) !==
false ) {
1514 $emails[] = $finalEmail;
1516 $emails[] =
'[mailto:'
1518 .
' <span class="email">'
1524 $email = implode(
', ', $emails );
1526 if ( isset( $vals[
'CiTelWork'] ) ) {
1527 $tel =
'<span class="tel">'
1528 . htmlspecialchars( $vals[
'CiTelWork'] )
1531 if ( isset( $vals[
'CiAdrPcode'] ) ) {
1532 $postal =
'<span class="postal-code">'
1534 $vals[
'CiAdrPcode'] )
1537 if ( isset( $vals[
'CiAdrRegion'] ) ) {
1539 $region =
'<span class="region">'
1541 $vals[
'CiAdrRegion'] )
1544 if ( isset( $vals[
'CiUrlWork'] ) ) {
1545 $url =
'<span class="url">'
1546 . htmlspecialchars( $vals[
'CiUrlWork'] )
1550 return $this->
msg(
'exif-contact-value', $email, $url,
1551 $street, $city, $region, $postal, $country,
1567 if ( preg_match(
'/^\\*\s*(.*?)\s*$/', $line,
$matches ) ) {
1571 $fields = array_map(
'strtolower', $fields );
1592 'getExtendedMetadata',
1594 (
int)$this->singleLang,
1598 $cachedValue =
$cache->get( $cacheKey );
1601 &&
Hooks::run(
'ValidateExtendedMetadataCache', [ $cachedValue[
'timestamp'], $file ] )
1603 $extendedMetadata = $cachedValue[
'data'];
1605 $maxCacheTime = ( $file instanceof
ForeignAPIFile ) ? 60 * 60 * 12 : 60 * 60 * 24 * 30;
1608 if ( $this->singleLang ) {
1617 $valueToCache = [
'data' => $extendedMetadata,
'timestamp' =>
wfTimestampNow() ];
1618 $cache->set( $cacheKey, $valueToCache, $maxCacheTime );
1621 return $extendedMetadata;
1639 return $file->getExtendedMetadata() ?: [];
1647 'value' => $uploadDate,
1648 'source' =>
'mediawiki-metadata',
1654 $text =
$title->getText();
1655 $pos = strrpos( $text,
'.' );
1658 $name = substr( $text, 0, $pos );
1663 $fileMetadata[
'ObjectName'] = [
1665 'source' =>
'mediawiki-metadata',
1669 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 ) {
1724 if ( isset(
$value[$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'] ) ) {
1817 if ( !is_array( $arr ) ) {
1822 foreach ( $arr
as $key => &
$value ) {
1824 if ( $sanitizedKey !== $key ) {
1825 if ( isset( $arr[$sanitizedKey] ) ) {
1830 $sanitizedKey .= $counter;
1833 $arr[$sanitizedKey] = $arr[$key];
1834 unset( $arr[$key] );
1836 if ( is_array(
$value ) ) {
1842 $keys = array_filter( array_keys( $arr ),
'ApiResult::isMetadataKey' );
1858 $key = preg_replace(
'/[^a-zA-z0-9_:.-]/',
'', $key );
1860 $key = preg_replace(
'/^[\d-.]+/',
'', $key );
1867 if ( $key ==
'_element' ) {
1881 $priorityLanguages =
1883 $priorityLanguages = array_merge(
1885 $priorityLanguages[0],
1886 $priorityLanguages[1]
1889 return $priorityLanguages;
setContext(IContextSource $context)
Set the IContextSource object.
static getMainWANInstance()
Get the main WAN cache 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
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
the array() calling protocol came about after MediaWiki 1.4rc1.
getLanguage()
Get the Language object.
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException'returning false will NOT prevent logging $e
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
if(!isset($args[0])) $lang
An IContextSource implementation which will inherit context from another source but allow individual ...
static getFallbacksIncludingSiteLanguage($code)
Get the ordered list of fallback languages, ending with the fallback language chain for the site lang...
when a variable name is used in a it is silently declared as a new local masking the global
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
getTitle()
Return the associated title object.
wfDebug($text, $dest= 'all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Foreign file accessible through api.php requests.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
isDeleted($field)
Is this file a "deleted" file in a private archive? STUB.
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 unsetoffset-wrap String Wrap the message in html(usually something like"<
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
getContext()
Get the base IContextSource object.
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
getSha1()
Get the SHA-1 base 36 hash of the file.
namespace and then decline to actually register it file or subcat img or subcat $title
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
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
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books $tag
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 fetchLanguageName($code, $inLanguage=null, $include= 'all')
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
getTimestamp()
Get the 14-character timestamp of the file upload.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
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 local content language as $wgContLang
static setPreserveKeysList(array &$arr, $names)
Preserve specified keys.
wfMemcKey()
Make a cache key for the local wiki.
Implements some public methods and some protected utility functions which are required by multiple ch...
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
see documentation in includes Linker php for Linker::makeImageLink & $time
Allows to change the fields on the form that will be generated $name