if ( $file ) {
$wikiText = file_get_contents( $file );
if ( substr( $file, -4 ) === '.txt' ) {
- $wikiText = Html::element( 'pre', array(), $wikiText );
+ $wikiText = Html::element(
+ 'pre',
+ array(
+ 'lang' => 'en',
+ 'dir' => 'ltr',
+ ),
+ $wikiText
+ );
}
}
}
$file = $this->getExtLicenseFileName( dirname( $extNode['path'] ) );
if ( $file ) {
$wikiText = file_get_contents( $file );
- $wikiText = "<pre>$wikiText</pre>";
+ $wikiText = Html::element(
+ 'pre',
+ array(
+ 'lang' => 'en',
+ 'dir' => 'ltr',
+ ),
+ $wikiText
+ );
}
}
*/
protected function getExternalLibraries() {
global $IP;
- $path = "$IP/composer.lock";
+ $path = "$IP/vendor/composer/installed.json";
if ( !file_exists( $path ) ) {
- // Maybe they're using mediawiki/vendor?
- $path = "$IP/vendor/composer.lock";
- if ( !file_exists( $path ) ) {
- return '';
- }
+ return '';
}
- $lock = new ComposerLock( $path );
+ $installed = new ComposerInstalled( $path );
$out = Html::element(
'h2',
array( 'id' => 'mw-version-libraries' ),
. Html::element( 'th', array(), $this->msg( 'version-libraries-authors' )->text() )
. Html::closeElement( 'tr' );
- foreach ( $lock->getInstalledDependencies() as $name => $info ) {
+ foreach ( $installed->getInstalledDependencies() as $name => $info ) {
if ( strpos( $info['type'], 'mediawiki-' ) === 0 ) {
// Skip any extensions or skins since they'll be listed
// in their proper section
foreach ( scandir( $extDir ) as $file ) {
$fullPath = $extDir . DIRECTORY_SEPARATOR . $file;
- if ( preg_match( '/^((AUTHORS)|(CREDITS))(\.txt)?$/', $file ) &&
+ if ( preg_match( '/^((AUTHORS)|(CREDITS))(\.txt|\.wiki|\.mediawiki)?$/', $file ) &&
is_readable( $fullPath ) &&
is_file( $fullPath )
) {