+ /**
+ * Generate an HTML table for external libraries that are installed
+ *
+ * @return string
+ */
+ protected function getExternalLibraries() {
+ global $IP;
+ $path = "$IP/composer.lock";
+ if ( !file_exists( $path ) ) {
+ // Maybe they're using mediawiki/vendor?
+ $path = "$IP/vendor/composer.lock";
+ if ( !file_exists( $path ) ) {
+ return '';
+ }
+ }
+
+ $lock = new ComposerLock( $path );
+ $out = Html::element(
+ 'h2',
+ array( 'id' => 'mw-version-libraries' ),
+ $this->msg( 'version-libraries' )->text()
+ );
+ $out .= Html::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'sv-libraries' ) );
+ $out .= Html::openElement( 'tr' )
+ . Html::element( 'th', array(), $this->msg( 'version-libraries-library' )->text() )
+ . Html::element( 'th', array(), $this->msg( 'version-libraries-version' )->text() )
+ . Html::closeElement( 'tr' );
+
+ foreach ( $lock->getInstalledDependencies() as $name => $info ) {
+ if ( strpos( $info['type'], 'mediawiki-' ) === 0 ) {
+ // Skip any extensions or skins since they'll be listed
+ // in their proper section
+ continue;
+ }
+ $out .= Html::openElement( 'tr' )
+ . Html::rawElement( 'td', array(), Linker::makeExternalLink( "https://packagist.org/packages/$name", $name ) )
+ . Html::element( 'td', array(), $info['version'] )
+ . Html::closeElement( 'tr' );
+ }
+ $out .= Html::closeElement( 'table' );
+
+ return $out;
+ }
+