MediaWiki  1.29.1
SpecialVersion.php
Go to the documentation of this file.
1 <?php
31 class SpecialVersion extends SpecialPage {
32  protected $firstExtOpened = false;
33 
37  protected $coreId = '';
38 
39  protected static $extensionTypes = false;
40 
41  public function __construct() {
42  parent::__construct( 'Version' );
43  }
44 
49  public function execute( $par ) {
50  global $IP, $wgExtensionCredits;
51 
52  $this->setHeaders();
53  $this->outputHeader();
54  $out = $this->getOutput();
55  $out->allowClickjacking();
56 
57  // Explode the sub page information into useful bits
58  $parts = explode( '/', (string)$par );
59  $extNode = null;
60  if ( isset( $parts[1] ) ) {
61  $extName = str_replace( '_', ' ', $parts[1] );
62  // Find it!
63  foreach ( $wgExtensionCredits as $group => $extensions ) {
64  foreach ( $extensions as $ext ) {
65  if ( isset( $ext['name'] ) && ( $ext['name'] === $extName ) ) {
66  $extNode = &$ext;
67  break 2;
68  }
69  }
70  }
71  if ( !$extNode ) {
72  $out->setStatusCode( 404 );
73  }
74  } else {
75  $extName = 'MediaWiki';
76  }
77 
78  // Now figure out what to do
79  switch ( strtolower( $parts[0] ) ) {
80  case 'credits':
81  $out->addModuleStyles( 'mediawiki.special.version' );
82 
83  $wikiText = '{{int:version-credits-not-found}}';
84  if ( $extName === 'MediaWiki' ) {
85  $wikiText = file_get_contents( $IP . '/CREDITS' );
86  // Put the contributor list into columns
87  $wikiText = str_replace(
88  [ '<!-- BEGIN CONTRIBUTOR LIST -->', '<!-- END CONTRIBUTOR LIST -->' ],
89  [ '<div class="mw-version-credits">', '</div>' ],
90  $wikiText );
91  } elseif ( ( $extNode !== null ) && isset( $extNode['path'] ) ) {
92  $file = $this->getExtAuthorsFileName( dirname( $extNode['path'] ) );
93  if ( $file ) {
94  $wikiText = file_get_contents( $file );
95  if ( substr( $file, -4 ) === '.txt' ) {
96  $wikiText = Html::element(
97  'pre',
98  [
99  'lang' => 'en',
100  'dir' => 'ltr',
101  ],
102  $wikiText
103  );
104  }
105  }
106  }
107 
108  $out->setPageTitle( $this->msg( 'version-credits-title', $extName ) );
109  $out->addWikiText( $wikiText );
110  break;
111 
112  case 'license':
113  $wikiText = '{{int:version-license-not-found}}';
114  if ( $extName === 'MediaWiki' ) {
115  $wikiText = file_get_contents( $IP . '/COPYING' );
116  } elseif ( ( $extNode !== null ) && isset( $extNode['path'] ) ) {
117  $file = $this->getExtLicenseFileName( dirname( $extNode['path'] ) );
118  if ( $file ) {
119  $wikiText = file_get_contents( $file );
120  $wikiText = Html::element(
121  'pre',
122  [
123  'lang' => 'en',
124  'dir' => 'ltr',
125  ],
126  $wikiText
127  );
128  }
129  }
130 
131  $out->setPageTitle( $this->msg( 'version-license-title', $extName ) );
132  $out->addWikiText( $wikiText );
133  break;
134 
135  default:
136  $out->addModuleStyles( 'mediawiki.special.version' );
137  $out->addWikiText(
138  $this->getMediaWikiCredits() .
139  $this->softwareInformation() .
140  $this->getEntryPointInfo()
141  );
142  $out->addHTML(
143  $this->getSkinCredits() .
144  $this->getExtensionCredits() .
145  $this->getExternalLibraries() .
146  $this->getParserTags() .
147  $this->getParserFunctionHooks()
148  );
149  $out->addWikiText( $this->getWgHooks() );
150  $out->addHTML( $this->IPInfo() );
151 
152  break;
153  }
154  }
155 
161  private static function getMediaWikiCredits() {
162  $ret = Xml::element(
163  'h2',
164  [ 'id' => 'mw-version-license' ],
165  wfMessage( 'version-license' )->text()
166  );
167 
168  // This text is always left-to-right.
169  $ret .= '<div class="plainlinks">';
170  $ret .= "__NOTOC__
172  " . wfMessage( 'version-license-info' )->text();
173  $ret .= '</div>';
174 
175  return str_replace( "\t\t", '', $ret ) . "\n";
176  }
177 
183  public static function getCopyrightAndAuthorList() {
184  global $wgLang;
185 
186  if ( defined( 'MEDIAWIKI_INSTALL' ) ) {
187  $othersLink = '[https://www.mediawiki.org/wiki/Special:Version/Credits ' .
188  wfMessage( 'version-poweredby-others' )->text() . ']';
189  } else {
190  $othersLink = '[[Special:Version/Credits|' .
191  wfMessage( 'version-poweredby-others' )->text() . ']]';
192  }
193 
194  $translatorsLink = '[https://translatewiki.net/wiki/Translating:MediaWiki/Credits ' .
195  wfMessage( 'version-poweredby-translators' )->text() . ']';
196 
197  $authorList = [
198  'Magnus Manske', 'Brion Vibber', 'Lee Daniel Crocker',
199  'Tim Starling', 'Erik Möller', 'Gabriel Wicke', 'Ævar Arnfjörð Bjarmason',
200  'Niklas Laxström', 'Domas Mituzas', 'Rob Church', 'Yuri Astrakhan',
201  'Aryeh Gregor', 'Aaron Schulz', 'Andrew Garrett', 'Raimond Spekking',
202  'Alexandre Emsenhuber', 'Siebrand Mazeland', 'Chad Horohoe',
203  'Roan Kattouw', 'Trevor Parscal', 'Bryan Tong Minh', 'Sam Reed',
204  'Victor Vasiliev', 'Rotem Liss', 'Platonides', 'Antoine Musso',
205  'Timo Tijhof', 'Daniel Kinzler', 'Jeroen De Dauw', 'Brad Jorsch',
206  $othersLink, $translatorsLink
207  ];
208 
209  return wfMessage( 'version-poweredby-credits', MWTimestamp::getLocalInstance()->format( 'Y' ),
210  $wgLang->listToText( $authorList ) )->text();
211  }
212 
218  public static function softwareInformation() {
219  $dbr = wfGetDB( DB_REPLICA );
220 
221  // Put the software in an array of form 'name' => 'version'. All messages should
222  // be loaded here, so feel free to use wfMessage in the 'name'. Raw HTML or
223  // wikimarkup can be used.
224  $software = [];
225  $software['[https://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked();
226  if ( wfIsHHVM() ) {
227  $software['[http://hhvm.com/ HHVM]'] = HHVM_VERSION . " (" . PHP_SAPI . ")";
228  } else {
229  $software['[https://php.net/ PHP]'] = PHP_VERSION . " (" . PHP_SAPI . ")";
230  }
231  $software[$dbr->getSoftwareLink()] = $dbr->getServerInfo();
232 
233  if ( IcuCollation::getICUVersion() ) {
234  $software['[http://site.icu-project.org/ ICU]'] = IcuCollation::getICUVersion();
235  }
236 
237  // Allow a hook to add/remove items.
238  Hooks::run( 'SoftwareInfo', [ &$software ] );
239 
240  $out = Xml::element(
241  'h2',
242  [ 'id' => 'mw-version-software' ],
243  wfMessage( 'version-software' )->text()
244  ) .
245  Xml::openElement( 'table', [ 'class' => 'wikitable plainlinks', 'id' => 'sv-software' ] ) .
246  "<tr>
247  <th>" . wfMessage( 'version-software-product' )->text() . "</th>
248  <th>" . wfMessage( 'version-software-version' )->text() . "</th>
249  </tr>\n";
250 
251  foreach ( $software as $name => $version ) {
252  $out .= "<tr>
253  <td>" . $name . "</td>
254  <td dir=\"ltr\">" . $version . "</td>
255  </tr>\n";
256  }
257 
258  return $out . Xml::closeElement( 'table' );
259  }
260 
268  public static function getVersion( $flags = '', $lang = null ) {
270 
271  $gitInfo = self::getGitHeadSha1( $IP );
272  if ( !$gitInfo ) {
273  $version = $wgVersion;
274  } elseif ( $flags === 'nodb' ) {
275  $shortSha1 = substr( $gitInfo, 0, 7 );
276  $version = "$wgVersion ($shortSha1)";
277  } else {
278  $shortSha1 = substr( $gitInfo, 0, 7 );
279  $msg = wfMessage( 'parentheses' );
280  if ( $lang !== null ) {
281  $msg->inLanguage( $lang );
282  }
283  $shortSha1 = $msg->params( $shortSha1 )->escaped();
284  $version = "$wgVersion $shortSha1";
285  }
286 
287  return $version;
288  }
289 
297  public static function getVersionLinked() {
299 
300  $gitVersion = self::getVersionLinkedGit();
301  if ( $gitVersion ) {
302  $v = $gitVersion;
303  } else {
304  $v = $wgVersion; // fallback
305  }
306 
307  return $v;
308  }
309 
313  private static function getwgVersionLinked() {
315  $versionUrl = "";
316  if ( Hooks::run( 'SpecialVersionVersionUrl', [ $wgVersion, &$versionUrl ] ) ) {
317  $versionParts = [];
318  preg_match( "/^(\d+\.\d+)/", $wgVersion, $versionParts );
319  $versionUrl = "https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]}";
320  }
321 
322  return "[$versionUrl $wgVersion]";
323  }
324 
330  private static function getVersionLinkedGit() {
331  global $IP, $wgLang;
332 
333  $gitInfo = new GitInfo( $IP );
334  $headSHA1 = $gitInfo->getHeadSHA1();
335  if ( !$headSHA1 ) {
336  return false;
337  }
338 
339  $shortSHA1 = '(' . substr( $headSHA1, 0, 7 ) . ')';
340 
341  $gitHeadUrl = $gitInfo->getHeadViewUrl();
342  if ( $gitHeadUrl !== false ) {
343  $shortSHA1 = "[$gitHeadUrl $shortSHA1]";
344  }
345 
346  $gitHeadCommitDate = $gitInfo->getHeadCommitDate();
347  if ( $gitHeadCommitDate ) {
348  $shortSHA1 .= Html::element( 'br' ) . $wgLang->timeanddate( $gitHeadCommitDate, true );
349  }
350 
351  return self::getwgVersionLinked() . " $shortSHA1";
352  }
353 
364  public static function getExtensionTypes() {
365  if ( self::$extensionTypes === false ) {
366  self::$extensionTypes = [
367  'specialpage' => wfMessage( 'version-specialpages' )->text(),
368  'parserhook' => wfMessage( 'version-parserhooks' )->text(),
369  'variable' => wfMessage( 'version-variables' )->text(),
370  'media' => wfMessage( 'version-mediahandlers' )->text(),
371  'antispam' => wfMessage( 'version-antispam' )->text(),
372  'skin' => wfMessage( 'version-skins' )->text(),
373  'api' => wfMessage( 'version-api' )->text(),
374  'other' => wfMessage( 'version-other' )->text(),
375  ];
376 
377  Hooks::run( 'ExtensionTypes', [ &self::$extensionTypes ] );
378  }
379 
380  return self::$extensionTypes;
381  }
382 
392  public static function getExtensionTypeName( $type ) {
393  $types = self::getExtensionTypes();
394 
395  return isset( $types[$type] ) ? $types[$type] : $types['other'];
396  }
397 
403  public function getExtensionCredits() {
404  global $wgExtensionCredits;
405 
406  if (
407  count( $wgExtensionCredits ) === 0 ||
408  // Skins are displayed separately, see getSkinCredits()
409  ( count( $wgExtensionCredits ) === 1 && isset( $wgExtensionCredits['skin'] ) )
410  ) {
411  return '';
412  }
413 
415 
416  $out = Xml::element(
417  'h2',
418  [ 'id' => 'mw-version-ext' ],
419  $this->msg( 'version-extensions' )->text()
420  ) .
421  Xml::openElement( 'table', [ 'class' => 'wikitable plainlinks', 'id' => 'sv-ext' ] );
422 
423  // Make sure the 'other' type is set to an array.
424  if ( !array_key_exists( 'other', $wgExtensionCredits ) ) {
425  $wgExtensionCredits['other'] = [];
426  }
427 
428  // Find all extensions that do not have a valid type and give them the type 'other'.
429  foreach ( $wgExtensionCredits as $type => $extensions ) {
430  if ( !array_key_exists( $type, $extensionTypes ) ) {
431  $wgExtensionCredits['other'] = array_merge( $wgExtensionCredits['other'], $extensions );
432  }
433  }
434 
435  $this->firstExtOpened = false;
436  // Loop through the extension categories to display their extensions in the list.
437  foreach ( $extensionTypes as $type => $message ) {
438  // Skins have a separate section
439  if ( $type !== 'other' && $type !== 'skin' ) {
440  $out .= $this->getExtensionCategory( $type, $message );
441  }
442  }
443 
444  // We want the 'other' type to be last in the list.
445  $out .= $this->getExtensionCategory( 'other', $extensionTypes['other'] );
446 
447  $out .= Xml::closeElement( 'table' );
448 
449  return $out;
450  }
451 
457  public function getSkinCredits() {
458  global $wgExtensionCredits;
459  if ( !isset( $wgExtensionCredits['skin'] ) || count( $wgExtensionCredits['skin'] ) === 0 ) {
460  return '';
461  }
462 
463  $out = Xml::element(
464  'h2',
465  [ 'id' => 'mw-version-skin' ],
466  $this->msg( 'version-skins' )->text()
467  ) .
468  Xml::openElement( 'table', [ 'class' => 'wikitable plainlinks', 'id' => 'sv-skin' ] );
469 
470  $this->firstExtOpened = false;
471  $out .= $this->getExtensionCategory( 'skin', null );
472 
473  $out .= Xml::closeElement( 'table' );
474 
475  return $out;
476  }
477 
483  protected function getExternalLibraries() {
484  global $IP;
485  $path = "$IP/vendor/composer/installed.json";
486  if ( !file_exists( $path ) ) {
487  return '';
488  }
489 
490  $installed = new ComposerInstalled( $path );
492  'h2',
493  [ 'id' => 'mw-version-libraries' ],
494  $this->msg( 'version-libraries' )->text()
495  );
497  'table',
498  [ 'class' => 'wikitable plainlinks', 'id' => 'sv-libraries' ]
499  );
500  $out .= Html::openElement( 'tr' )
501  . Html::element( 'th', [], $this->msg( 'version-libraries-library' )->text() )
502  . Html::element( 'th', [], $this->msg( 'version-libraries-version' )->text() )
503  . Html::element( 'th', [], $this->msg( 'version-libraries-license' )->text() )
504  . Html::element( 'th', [], $this->msg( 'version-libraries-description' )->text() )
505  . Html::element( 'th', [], $this->msg( 'version-libraries-authors' )->text() )
506  . Html::closeElement( 'tr' );
507 
508  foreach ( $installed->getInstalledDependencies() as $name => $info ) {
509  if ( strpos( $info['type'], 'mediawiki-' ) === 0 ) {
510  // Skip any extensions or skins since they'll be listed
511  // in their proper section
512  continue;
513  }
514  $authors = array_map( function( $arr ) {
515  // If a homepage is set, link to it
516  if ( isset( $arr['homepage'] ) ) {
517  return "[{$arr['homepage']} {$arr['name']}]";
518  }
519  return $arr['name'];
520  }, $info['authors'] );
521  $authors = $this->listAuthors( $authors, false, "$IP/vendor/$name" );
522 
523  // We can safely assume that the libraries' names and descriptions
524  // are written in English and aren't going to be translated,
525  // so set appropriate lang and dir attributes
526  $out .= Html::openElement( 'tr' )
528  'td',
529  [],
531  "https://packagist.org/packages/$name", $name,
532  true, '',
533  [ 'class' => 'mw-version-library-name' ]
534  )
535  )
536  . Html::element( 'td', [ 'dir' => 'auto' ], $info['version'] )
537  . Html::element( 'td', [ 'dir' => 'auto' ], $this->listToText( $info['licenses'] ) )
538  . Html::element( 'td', [ 'lang' => 'en', 'dir' => 'ltr' ], $info['description'] )
539  . Html::rawElement( 'td', [], $authors )
540  . Html::closeElement( 'tr' );
541  }
542  $out .= Html::closeElement( 'table' );
543 
544  return $out;
545  }
546 
552  protected function getParserTags() {
554 
555  $tags = $wgParser->getTags();
556 
557  if ( count( $tags ) ) {
559  'h2',
560  [
561  'class' => 'mw-headline plainlinks',
562  'id' => 'mw-version-parser-extensiontags',
563  ],
565  'https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Tag_extensions',
566  $this->msg( 'version-parser-extensiontags' )->parse(),
567  false /* msg()->parse() already escapes */
568  )
569  );
570 
571  array_walk( $tags, function ( &$value ) {
572  // Bidirectional isolation improves readability in RTL wikis
574  'bdi',
575  // Prevent < and > from slipping to another line
576  [
577  'style' => 'white-space: nowrap;',
578  ],
579  "<$value>"
580  );
581  } );
582 
583  $out .= $this->listToText( $tags );
584  } else {
585  $out = '';
586  }
587 
588  return $out;
589  }
590 
596  protected function getParserFunctionHooks() {
598 
599  $fhooks = $wgParser->getFunctionHooks();
600  if ( count( $fhooks ) ) {
602  'h2',
603  [
604  'class' => 'mw-headline plainlinks',
605  'id' => 'mw-version-parser-function-hooks',
606  ],
608  'https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Parser_functions',
609  $this->msg( 'version-parser-function-hooks' )->parse(),
610  false /* msg()->parse() already escapes */
611  )
612  );
613 
614  $out .= $this->listToText( $fhooks );
615  } else {
616  $out = '';
617  }
618 
619  return $out;
620  }
621 
632  protected function getExtensionCategory( $type, $message ) {
633  global $wgExtensionCredits;
634 
635  $out = '';
636 
637  if ( array_key_exists( $type, $wgExtensionCredits ) && count( $wgExtensionCredits[$type] ) > 0 ) {
638  $out .= $this->openExtType( $message, 'credits-' . $type );
639 
640  usort( $wgExtensionCredits[$type], [ $this, 'compare' ] );
641 
642  foreach ( $wgExtensionCredits[$type] as $extension ) {
643  $out .= $this->getCreditsForExtension( $type, $extension );
644  }
645  }
646 
647  return $out;
648  }
649 
656  public function compare( $a, $b ) {
657  if ( $a['name'] === $b['name'] ) {
658  return 0;
659  } else {
660  return $this->getLanguage()->lc( $a['name'] ) > $this->getLanguage()->lc( $b['name'] )
661  ? 1
662  : -1;
663  }
664  }
665 
684  public function getCreditsForExtension( $type, array $extension ) {
685  $out = $this->getOutput();
686 
687  // We must obtain the information for all the bits and pieces!
688  // ... such as extension names and links
689  if ( isset( $extension['namemsg'] ) ) {
690  // Localized name of extension
691  $extensionName = $this->msg( $extension['namemsg'] )->text();
692  } elseif ( isset( $extension['name'] ) ) {
693  // Non localized version
694  $extensionName = $extension['name'];
695  } else {
696  $extensionName = $this->msg( 'version-no-ext-name' )->text();
697  }
698 
699  if ( isset( $extension['url'] ) ) {
700  $extensionNameLink = Linker::makeExternalLink(
701  $extension['url'],
702  $extensionName,
703  true,
704  '',
705  [ 'class' => 'mw-version-ext-name' ]
706  );
707  } else {
708  $extensionNameLink = $extensionName;
709  }
710 
711  // ... and the version information
712  // If the extension path is set we will check that directory for GIT
713  // metadata in an attempt to extract date and vcs commit metadata.
714  $canonicalVersion = '&ndash;';
715  $extensionPath = null;
716  $vcsVersion = null;
717  $vcsLink = null;
718  $vcsDate = null;
719 
720  if ( isset( $extension['version'] ) ) {
721  $canonicalVersion = $out->parseInline( $extension['version'] );
722  }
723 
724  if ( isset( $extension['path'] ) ) {
725  global $IP;
726  $extensionPath = dirname( $extension['path'] );
727  if ( $this->coreId == '' ) {
728  wfDebug( 'Looking up core head id' );
729  $coreHeadSHA1 = self::getGitHeadSha1( $IP );
730  if ( $coreHeadSHA1 ) {
731  $this->coreId = $coreHeadSHA1;
732  }
733  }
735  $memcKey = wfMemcKey( 'specialversion-ext-version-text', $extension['path'], $this->coreId );
736  list( $vcsVersion, $vcsLink, $vcsDate ) = $cache->get( $memcKey );
737 
738  if ( !$vcsVersion ) {
739  wfDebug( "Getting VCS info for extension {$extension['name']}" );
740  $gitInfo = new GitInfo( $extensionPath );
741  $vcsVersion = $gitInfo->getHeadSHA1();
742  if ( $vcsVersion !== false ) {
743  $vcsVersion = substr( $vcsVersion, 0, 7 );
744  $vcsLink = $gitInfo->getHeadViewUrl();
745  $vcsDate = $gitInfo->getHeadCommitDate();
746  }
747  $cache->set( $memcKey, [ $vcsVersion, $vcsLink, $vcsDate ], 60 * 60 * 24 );
748  } else {
749  wfDebug( "Pulled VCS info for extension {$extension['name']} from cache" );
750  }
751  }
752 
753  $versionString = Html::rawElement(
754  'span',
755  [ 'class' => 'mw-version-ext-version' ],
756  $canonicalVersion
757  );
758 
759  if ( $vcsVersion ) {
760  if ( $vcsLink ) {
761  $vcsVerString = Linker::makeExternalLink(
762  $vcsLink,
763  $this->msg( 'version-version', $vcsVersion ),
764  true,
765  '',
766  [ 'class' => 'mw-version-ext-vcs-version' ]
767  );
768  } else {
769  $vcsVerString = Html::element( 'span',
770  [ 'class' => 'mw-version-ext-vcs-version' ],
771  "({$vcsVersion})"
772  );
773  }
774  $versionString .= " {$vcsVerString}";
775 
776  if ( $vcsDate ) {
777  $vcsTimeString = Html::element( 'span',
778  [ 'class' => 'mw-version-ext-vcs-timestamp' ],
779  $this->getLanguage()->timeanddate( $vcsDate, true )
780  );
781  $versionString .= " {$vcsTimeString}";
782  }
783  $versionString = Html::rawElement( 'span',
784  [ 'class' => 'mw-version-ext-meta-version' ],
785  $versionString
786  );
787  }
788 
789  // ... and license information; if a license file exists we
790  // will link to it
791  $licenseLink = '';
792  if ( isset( $extension['name'] ) ) {
793  $licenseName = null;
794  if ( isset( $extension['license-name'] ) ) {
795  $licenseName = new HtmlArmor( $out->parseInline( $extension['license-name'] ) );
796  } elseif ( $this->getExtLicenseFileName( $extensionPath ) ) {
797  $licenseName = $this->msg( 'version-ext-license' )->text();
798  }
799  if ( $licenseName !== null ) {
800  $licenseLink = $this->getLinkRenderer()->makeLink(
801  $this->getPageTitle( 'License/' . $extension['name'] ),
802  $licenseName,
803  [
804  'class' => 'mw-version-ext-license',
805  'dir' => 'auto',
806  ]
807  );
808  }
809  }
810 
811  // ... and generate the description; which can be a parameterized l10n message
812  // in the form array( <msgname>, <parameter>, <parameter>... ) or just a straight
813  // up string
814  if ( isset( $extension['descriptionmsg'] ) ) {
815  // Localized description of extension
816  $descriptionMsg = $extension['descriptionmsg'];
817 
818  if ( is_array( $descriptionMsg ) ) {
819  $descriptionMsgKey = $descriptionMsg[0]; // Get the message key
820  array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only
821  array_map( "htmlspecialchars", $descriptionMsg ); // For sanity
822  $description = $this->msg( $descriptionMsgKey, $descriptionMsg )->text();
823  } else {
824  $description = $this->msg( $descriptionMsg )->text();
825  }
826  } elseif ( isset( $extension['description'] ) ) {
827  // Non localized version
828  $description = $extension['description'];
829  } else {
830  $description = '';
831  }
832  $description = $out->parseInline( $description );
833 
834  // ... now get the authors for this extension
835  $authors = isset( $extension['author'] ) ? $extension['author'] : [];
836  $authors = $this->listAuthors( $authors, $extension['name'], $extensionPath );
837 
838  // Finally! Create the table
839  $html = Html::openElement( 'tr', [
840  'class' => 'mw-version-ext',
841  'id' => Sanitizer::escapeId( 'mw-version-ext-' . $type . '-' . $extension['name'] )
842  ]
843  );
844 
845  $html .= Html::rawElement( 'td', [], $extensionNameLink );
846  $html .= Html::rawElement( 'td', [], $versionString );
847  $html .= Html::rawElement( 'td', [], $licenseLink );
848  $html .= Html::rawElement( 'td', [ 'class' => 'mw-version-ext-description' ], $description );
849  $html .= Html::rawElement( 'td', [ 'class' => 'mw-version-ext-authors' ], $authors );
850 
851  $html .= Html::closeElement( 'tr' );
852 
853  return $html;
854  }
855 
861  private function getWgHooks() {
862  global $wgSpecialVersionShowHooks, $wgHooks;
863 
864  if ( $wgSpecialVersionShowHooks && count( $wgHooks ) ) {
865  $myWgHooks = $wgHooks;
866  ksort( $myWgHooks );
867 
868  $ret = [];
869  $ret[] = '== {{int:version-hooks}} ==';
870  $ret[] = Html::openElement( 'table', [ 'class' => 'wikitable', 'id' => 'sv-hooks' ] );
871  $ret[] = Html::openElement( 'tr' );
872  $ret[] = Html::element( 'th', [], $this->msg( 'version-hook-name' )->text() );
873  $ret[] = Html::element( 'th', [], $this->msg( 'version-hook-subscribedby' )->text() );
874  $ret[] = Html::closeElement( 'tr' );
875 
876  foreach ( $myWgHooks as $hook => $hooks ) {
877  $ret[] = Html::openElement( 'tr' );
878  $ret[] = Html::element( 'td', [], $hook );
879  $ret[] = Html::element( 'td', [], $this->listToText( $hooks ) );
880  $ret[] = Html::closeElement( 'tr' );
881  }
882 
883  $ret[] = Html::closeElement( 'table' );
884 
885  return implode( "\n", $ret );
886  } else {
887  return '';
888  }
889  }
890 
891  private function openExtType( $text = null, $name = null ) {
892  $out = '';
893 
894  $opt = [ 'colspan' => 5 ];
895  if ( $this->firstExtOpened ) {
896  // Insert a spacing line
897  $out .= Html::rawElement( 'tr', [ 'class' => 'sv-space' ],
898  Html::element( 'td', $opt )
899  );
900  }
901  $this->firstExtOpened = true;
902 
903  if ( $name ) {
904  $opt['id'] = "sv-$name";
905  }
906 
907  if ( $text !== null ) {
908  $out .= Html::rawElement( 'tr', [],
909  Html::element( 'th', $opt, $text )
910  );
911  }
912 
913  $firstHeadingMsg = ( $name === 'credits-skin' )
914  ? 'version-skin-colheader-name'
915  : 'version-ext-colheader-name';
916  $out .= Html::openElement( 'tr' );
917  $out .= Html::element( 'th', [ 'class' => 'mw-version-ext-col-label' ],
918  $this->msg( $firstHeadingMsg )->text() );
919  $out .= Html::element( 'th', [ 'class' => 'mw-version-ext-col-label' ],
920  $this->msg( 'version-ext-colheader-version' )->text() );
921  $out .= Html::element( 'th', [ 'class' => 'mw-version-ext-col-label' ],
922  $this->msg( 'version-ext-colheader-license' )->text() );
923  $out .= Html::element( 'th', [ 'class' => 'mw-version-ext-col-label' ],
924  $this->msg( 'version-ext-colheader-description' )->text() );
925  $out .= Html::element( 'th', [ 'class' => 'mw-version-ext-col-label' ],
926  $this->msg( 'version-ext-colheader-credits' )->text() );
927  $out .= Html::closeElement( 'tr' );
928 
929  return $out;
930  }
931 
937  private function IPInfo() {
938  $ip = str_replace( '--', ' - ', htmlspecialchars( $this->getRequest()->getIP() ) );
939 
940  return "<!-- visited from $ip -->\n<span style='display:none'>visited from $ip</span>";
941  }
942 
964  public function listAuthors( $authors, $extName, $extDir ) {
965  $hasOthers = false;
966  $linkRenderer = $this->getLinkRenderer();
967 
968  $list = [];
969  foreach ( (array)$authors as $item ) {
970  if ( $item == '...' ) {
971  $hasOthers = true;
972 
973  if ( $extName && $this->getExtAuthorsFileName( $extDir ) ) {
974  $text = $linkRenderer->makeLink(
975  $this->getPageTitle( "Credits/$extName" ),
976  $this->msg( 'version-poweredby-others' )->text()
977  );
978  } else {
979  $text = $this->msg( 'version-poweredby-others' )->escaped();
980  }
981  $list[] = $text;
982  } elseif ( substr( $item, -5 ) == ' ...]' ) {
983  $hasOthers = true;
984  $list[] = $this->getOutput()->parseInline(
985  substr( $item, 0, -4 ) . $this->msg( 'version-poweredby-others' )->text() . "]"
986  );
987  } else {
988  $list[] = $this->getOutput()->parseInline( $item );
989  }
990  }
991 
992  if ( $extName && !$hasOthers && $this->getExtAuthorsFileName( $extDir ) ) {
993  $list[] = $text = $linkRenderer->makeLink(
994  $this->getPageTitle( "Credits/$extName" ),
995  $this->msg( 'version-poweredby-others' )->text()
996  );
997  }
998 
999  return $this->listToText( $list, false );
1000  }
1001 
1013  public static function getExtAuthorsFileName( $extDir ) {
1014  if ( !$extDir ) {
1015  return false;
1016  }
1017 
1018  foreach ( scandir( $extDir ) as $file ) {
1019  $fullPath = $extDir . DIRECTORY_SEPARATOR . $file;
1020  if ( preg_match( '/^((AUTHORS)|(CREDITS))(\.txt|\.wiki|\.mediawiki)?$/', $file ) &&
1021  is_readable( $fullPath ) &&
1022  is_file( $fullPath )
1023  ) {
1024  return $fullPath;
1025  }
1026  }
1027 
1028  return false;
1029  }
1030 
1042  public static function getExtLicenseFileName( $extDir ) {
1043  if ( !$extDir ) {
1044  return false;
1045  }
1046 
1047  foreach ( scandir( $extDir ) as $file ) {
1048  $fullPath = $extDir . DIRECTORY_SEPARATOR . $file;
1049  if ( preg_match( '/^((COPYING)|(LICENSE))(\.txt)?$/', $file ) &&
1050  is_readable( $fullPath ) &&
1051  is_file( $fullPath )
1052  ) {
1053  return $fullPath;
1054  }
1055  }
1056 
1057  return false;
1058  }
1059 
1068  public function listToText( $list, $sort = true ) {
1069  if ( !count( $list ) ) {
1070  return '';
1071  }
1072  if ( $sort ) {
1073  sort( $list );
1074  }
1075 
1076  return $this->getLanguage()
1077  ->listToText( array_map( [ __CLASS__, 'arrayToString' ], $list ) );
1078  }
1079 
1088  public static function arrayToString( $list ) {
1089  if ( is_array( $list ) && count( $list ) == 1 ) {
1090  $list = $list[0];
1091  }
1092  if ( $list instanceof Closure ) {
1093  // Don't output stuff like "Closure$;1028376090#8$48499d94fe0147f7c633b365be39952b$"
1094  return 'Closure';
1095  } elseif ( is_object( $list ) ) {
1096  $class = wfMessage( 'parentheses' )->params( get_class( $list ) )->escaped();
1097 
1098  return $class;
1099  } elseif ( !is_array( $list ) ) {
1100  return $list;
1101  } else {
1102  if ( is_object( $list[0] ) ) {
1103  $class = get_class( $list[0] );
1104  } else {
1105  $class = $list[0];
1106  }
1107 
1108  return wfMessage( 'parentheses' )->params( "$class, {$list[1]}" )->escaped();
1109  }
1110  }
1111 
1116  public static function getGitHeadSha1( $dir ) {
1117  $repo = new GitInfo( $dir );
1118 
1119  return $repo->getHeadSHA1();
1120  }
1121 
1126  public static function getGitCurrentBranch( $dir ) {
1127  $repo = new GitInfo( $dir );
1128  return $repo->getCurrentBranch();
1129  }
1130 
1135  public function getEntryPointInfo() {
1137  $scriptPath = $wgScriptPath ? $wgScriptPath : "/";
1138  $entryPoints = [
1139  'version-entrypoints-articlepath' => $wgArticlePath,
1140  'version-entrypoints-scriptpath' => $scriptPath,
1141  'version-entrypoints-index-php' => wfScript( 'index' ),
1142  'version-entrypoints-api-php' => wfScript( 'api' ),
1143  'version-entrypoints-load-php' => wfScript( 'load' ),
1144  ];
1145 
1146  $language = $this->getLanguage();
1147  $thAttribures = [
1148  'dir' => $language->getDir(),
1149  'lang' => $language->getHtmlCode()
1150  ];
1151  $out = Html::element(
1152  'h2',
1153  [ 'id' => 'mw-version-entrypoints' ],
1154  $this->msg( 'version-entrypoints' )->text()
1155  ) .
1156  Html::openElement( 'table',
1157  [
1158  'class' => 'wikitable plainlinks',
1159  'id' => 'mw-version-entrypoints-table',
1160  'dir' => 'ltr',
1161  'lang' => 'en'
1162  ]
1163  ) .
1164  Html::openElement( 'tr' ) .
1165  Html::element(
1166  'th',
1167  $thAttribures,
1168  $this->msg( 'version-entrypoints-header-entrypoint' )->text()
1169  ) .
1170  Html::element(
1171  'th',
1172  $thAttribures,
1173  $this->msg( 'version-entrypoints-header-url' )->text()
1174  ) .
1175  Html::closeElement( 'tr' );
1176 
1177  foreach ( $entryPoints as $message => $value ) {
1178  $url = wfExpandUrl( $value, PROTO_RELATIVE );
1179  $out .= Html::openElement( 'tr' ) .
1180  // ->text() looks like it should be ->parse(), but this function
1181  // returns wikitext, not HTML, boo
1182  Html::rawElement( 'td', [], $this->msg( $message )->text() ) .
1183  Html::rawElement( 'td', [], Html::rawElement( 'code', [], "[$url $value]" ) ) .
1184  Html::closeElement( 'tr' );
1185  }
1186 
1187  $out .= Html::closeElement( 'table' );
1188 
1189  return $out;
1190  }
1191 
1192  protected function getGroupName() {
1193  return 'wiki';
1194  }
1195 }
SpecialVersion\getExtensionCredits
getExtensionCredits()
Generate wikitext showing the name, URL, author and description of each extension.
Definition: SpecialVersion.php:403
SpecialVersion\openExtType
openExtType( $text=null, $name=null)
Definition: SpecialVersion.php:891
SpecialPage\getPageTitle
getPageTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:628
SpecialVersion\__construct
__construct()
Definition: SpecialVersion.php:41
SpecialVersion\listAuthors
listAuthors( $authors, $extName, $extDir)
Return a formatted unsorted list of authors.
Definition: SpecialVersion.php:964
HtmlArmor
Marks HTML that shouldn't be escaped.
Definition: HtmlArmor.php:28
SpecialVersion\getExtAuthorsFileName
static getExtAuthorsFileName( $extDir)
Obtains the full path of an extensions authors or credits file if one exists.
Definition: SpecialVersion.php:1013
$wgParser
$wgParser
Definition: Setup.php:796
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:675
SpecialVersion\listToText
listToText( $list, $sort=true)
Convert an array of items into a list for display.
Definition: SpecialVersion.php:1068
SpecialVersion\getMediaWikiCredits
static getMediaWikiCredits()
Returns wiki text showing the license information.
Definition: SpecialVersion.php:161
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:33
$opt
$opt
Definition: postprocess-phan.php:115
SpecialVersion\getCreditsForExtension
getCreditsForExtension( $type, array $extension)
Creates and formats a version line for a single extension.
Definition: SpecialVersion.php:684
captcha-old.count
count
Definition: captcha-old.py:225
text
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
Definition: design.txt:12
SpecialVersion\compare
compare( $a, $b)
Callback to sort extensions by type.
Definition: SpecialVersion.php:656
SpecialVersion\getCopyrightAndAuthorList
static getCopyrightAndAuthorList()
Get the "MediaWiki is copyright 2001-20xx by lots of cool guys" text.
Definition: SpecialVersion.php:183
$wgVersion
$wgVersion
MediaWiki version number.
Definition: DefaultSettings.php:78
SpecialVersion\$coreId
$coreId
Stores the current rev id/SHA hash of MediaWiki core.
Definition: SpecialVersion.php:37
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:304
SpecialPage\getLanguage
getLanguage()
Shortcut to get user's language.
Definition: SpecialPage.php:705
SpecialVersion\getParserFunctionHooks
getParserFunctionHooks()
Obtains a list of installed parser function hooks and the associated H2 header.
Definition: SpecialVersion.php:596
$type
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 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
Definition: hooks.txt:2536
Xml\openElement
static openElement( $element, $attribs=null)
This opens an XML element.
Definition: Xml.php:109
php
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
Definition: injection.txt:35
SpecialVersion\getVersionLinked
static getVersionLinked()
Return a wikitext-formatted string of the MediaWiki version with a link to the Git SHA1 of head if av...
Definition: SpecialVersion.php:297
SpecialVersion\arrayToString
static arrayToString( $list)
Convert an array or object to a string for display.
Definition: SpecialVersion.php:1088
SpecialVersion\softwareInformation
static softwareInformation()
Returns wiki text showing the third party software versions (apache, php, mysql).
Definition: SpecialVersion.php:218
Html\closeElement
static closeElement( $element)
Returns "</$element>".
Definition: Html.php:309
SpecialVersion\$extensionTypes
static $extensionTypes
Definition: SpecialVersion.php:39
SpecialVersion\IPInfo
IPInfo()
Get information about client's IP address.
Definition: SpecialVersion.php:937
SpecialVersion\getExternalLibraries
getExternalLibraries()
Generate an HTML table for external libraries that are installed.
Definition: SpecialVersion.php:483
$html
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
Definition: hooks.txt:1956
wfMemcKey
wfMemcKey()
Make a cache key for the local wiki.
Definition: GlobalFunctions.php:2961
SpecialVersion\getSkinCredits
getSkinCredits()
Generate wikitext showing the name, URL, author and description of each skin.
Definition: SpecialVersion.php:457
wfScript
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
Definition: GlobalFunctions.php:3138
SpecialVersion\getExtensionTypeName
static getExtensionTypeName( $type)
Returns the internationalized name for an extension type.
Definition: SpecialVersion.php:392
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3060
$IP
$IP
Definition: update.php:3
IcuCollation\getICUVersion
static getICUVersion()
Return the version of ICU library used by PHP's intl extension, or false when the extension is not in...
Definition: IcuCollation.php:526
Xml\element
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
Definition: Xml.php:39
$wgLang
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 $wgLang
Definition: design.txt:56
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:484
SpecialVersion\getExtensionTypes
static getExtensionTypes()
Returns an array with the base extension types.
Definition: SpecialVersion.php:364
Linker\makeExternalLink
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
Definition: Linker.php:838
wfGetCache
wfGetCache( $cacheType)
Get a specific cache object.
Definition: GlobalFunctions.php:3398
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
SpecialVersion\getWgHooks
getWgHooks()
Generate wikitext showing hooks in $wgHooks.
Definition: SpecialVersion.php:861
wfDebug
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:999
list
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
Definition: deferred.txt:11
$dir
$dir
Definition: Autoload.php:8
$sort
$sort
Definition: profileinfo.php:323
SpecialVersion\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialVersion.php:1192
SpecialVersion\getExtLicenseFileName
static getExtLicenseFileName( $extDir)
Obtains the full path of an extensions copying or license file if one exists.
Definition: SpecialVersion.php:1042
SpecialVersion\getwgVersionLinked
static getwgVersionLinked()
Definition: SpecialVersion.php:313
SpecialVersion\execute
execute( $par)
main()
Definition: SpecialVersion.php:49
SpecialVersion\getVersion
static getVersion( $flags='', $lang=null)
Return a string of the MediaWiki version with Git revision if available.
Definition: SpecialVersion.php:268
GitInfo
Definition: GitInfo.php:26
$value
$value
Definition: styleTest.css.php:45
SpecialVersion\getGitCurrentBranch
static getGitCurrentBranch( $dir)
Definition: SpecialVersion.php:1126
SpecialPage\msg
msg()
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:746
SpecialPage
Parent class for all special pages.
Definition: SpecialPage.php:36
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:665
CACHE_ANYTHING
const CACHE_ANYTHING
Definition: Defines.php:99
SpecialVersion
Give information about the version of MediaWiki, PHP, the DB and extensions.
Definition: SpecialVersion.php:31
PROTO_RELATIVE
const PROTO_RELATIVE
Definition: Defines.php:219
$ret
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Definition: hooks.txt:1956
SpecialVersion\getGitHeadSha1
static getGitHeadSha1( $dir)
Definition: SpecialVersion.php:1116
format
if the prop value should be in the metadata multi language array format
Definition: hooks.txt:1630
SpecialVersion\getEntryPointInfo
getEntryPointInfo()
Get the list of entry points and their URLs.
Definition: SpecialVersion.php:1135
SpecialVersion\$firstExtOpened
$firstExtOpened
Definition: SpecialVersion.php:32
$wgArticlePath
$wgArticlePath
Definition: img_auth.php:45
SpecialPage\getLinkRenderer
getLinkRenderer()
Definition: SpecialPage.php:856
SpecialVersion\getVersionLinkedGit
static getVersionLinkedGit()
Definition: SpecialVersion.php:330
Xml\closeElement
static closeElement( $element)
Shortcut to close an XML element.
Definition: Xml.php:118
$dbr
if(! $regexes) $dbr
Definition: cleanup.php:94
$cache
$cache
Definition: mcc.php:33
$ext
$ext
Definition: NoLocalSettings.php:25
$wgHooks
$wgHooks['ArticleShow'][]
Definition: hooks.txt:110
$path
$path
Definition: NoLocalSettings.php:26
as
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
Definition: distributors.txt:9
Html\openElement
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
Definition: Html.php:251
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:209
wfMessage
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 "&lt
SpecialPage\$linkRenderer
MediaWiki Linker LinkRenderer null $linkRenderer
Definition: SpecialPage.php:66
Html\element
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:231
SpecialVersion\getParserTags
getParserTags()
Obtains a list of installed parser tags and the associated H2 header.
Definition: SpecialVersion.php:552
wfIsHHVM
wfIsHHVM()
Check if we are running under HHVM.
Definition: GlobalFunctions.php:2046
$wgScriptPath
$wgScriptPath
The path we should point to.
Definition: DefaultSettings.php:141
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:131
MWTimestamp\getLocalInstance
static getLocalInstance( $ts=false)
Get a timestamp instance in the server local timezone ($wgLocaltimezone)
Definition: MWTimestamp.php:204
ComposerInstalled
Reads an installed.json file and provides accessors to get what is installed.
Definition: ComposerInstalled.php:9
SpecialPage\outputHeader
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Definition: SpecialPage.php:583
$flags
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Definition: hooks.txt:2749
wfExpandUrl
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
Definition: GlobalFunctions.php:552
array
the array() calling protocol came about after MediaWiki 1.4rc1.
$out
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
Definition: hooks.txt:783
SpecialVersion\getExtensionCategory
getExtensionCategory( $type, $message)
Creates and returns the HTML for a single extension category.
Definition: SpecialVersion.php:632