$deps[$installed['name']] = array(
'version' => ComposerJson::normalizeVersion( $installed['version'] ),
'type' => $installed['type'],
+ 'licenses' => isset( $installed['license'] ) ? $installed['license'] : array(),
+ 'authors' => isset( $installed['authors'] ) ? $installed['authors'] : array(),
+ 'description' => isset( $installed['description'] ) ? $installed['description']: '',
);
}
$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::element( 'th', array(), $this->msg( 'version-libraries-license' )->text() )
+ . Html::element( 'th', array(), $this->msg( 'version-libraries-description' )->text() )
+ . Html::element( 'th', array(), $this->msg( 'version-libraries-authors' )->text() )
. Html::closeElement( 'tr' );
foreach ( $lock->getInstalledDependencies() as $name => $info ) {
// in their proper section
continue;
}
+ $authors = array_map( function( $arr ) {
+ // If a homepage is set, link to it
+ if ( isset( $arr['homepage'] ) ) {
+ return "[{$arr['homepage']} {$arr['name']}]";
+ }
+ return $arr['name'];
+ }, $info['authors'] );
+ $authors = $this->listAuthors( $authors, false, "$IP/vendor/$name" );
$out .= Html::openElement( 'tr' )
. Html::rawElement(
'td',
array(),
- Linker::makeExternalLink( "https://packagist.org/packages/$name", $name )
+ Linker::makeExternalLink(
+ "https://packagist.org/packages/$name", $name,
+ true, '',
+ array( 'class' => 'mw-version-library-name' )
+ )
)
. Html::element( 'td', array(), $info['version'] )
+ . Html::element( 'td', array(), $this->listToText( $info['licenses'] ) )
+ . Html::element( 'td', array(), $info['description'] )
+ . Html::rawElement( 'td', array(), $authors )
. Html::closeElement( 'tr' );
}
$out .= Html::closeElement( 'table' );
* 'and others' will be added to the end of the credits.
*
* @param string|array $authors
- * @param string $extName Name of the extension for link creation
+ * @param string|bool $extName Name of the extension for link creation,
+ * false if no links should be created
* @param string $extDir Path to the extension root directory
*
* @return string HTML fragment
if ( $item == '...' ) {
$hasOthers = true;
- if ( $this->getExtAuthorsFileName( $extDir ) ) {
+ if ( $extName && $this->getExtAuthorsFileName( $extDir ) ) {
$text = Linker::link(
$this->getPageTitle( "Credits/$extName" ),
$this->msg( 'version-poweredby-others' )->escaped()
}
}
- if ( !$hasOthers && $this->getExtAuthorsFileName( $extDir ) ) {
+ if ( $extName && !$hasOthers && $this->getExtAuthorsFileName( $extDir ) ) {
$list[] = $text = Linker::link(
$this->getPageTitle( "Credits/$extName" ),
$this->msg( 'version-poweredby-others' )->escaped()
"version-libraries": "Installed libraries",
"version-libraries-library": "Library",
"version-libraries-version": "Version",
+ "version-libraries-license": "License",
+ "version-libraries-description": "Description",
+ "version-libraries-authors": "Authors",
"redirect": "Redirect by file, user, page or revision ID",
"redirect-legend": "Redirect to a file or page",
"redirect-text": "",
"version-libraries": "Header on [[Special:Version]] above a table that lists installed external libraries and their version numbers.",
"version-libraries-library": "Column header for the library's name\n{{Identical|Library}}",
"version-libraries-version": "Column header for the library's version number\n{{Identical|Version}}",
+ "version-libraries-license": "Column header for the library's license",
+ "version-libraries-description": "Column header for the library's description",
+ "version-libraries-authors": "Column header for the library's authors",
"redirect": "{{doc-special|Redirect}}\nThis means \"Redirect by file'''name''', user '''ID''', page '''ID''', or revision ID\".",
"redirect-legend": "Legend of fieldset around input box in [[Special:Redirect]]",
"redirect-text": "Inside fieldset for [[Special:Redirect]]",
/*!
* Styling for Special:Version
*/
-.mw-version-ext-name {
+.mw-version-ext-name,
+.mw-version-library-name {
font-weight: bold;
}
'wikimedia/cdb' => array(
'version' => '1.0.1',
'type' => 'library',
+ 'licenses' => array( 'GPL-2.0' ),
+ 'authors' => array(
+ array(
+ 'name' => 'Tim Starling',
+ 'email' => 'tstarling@wikimedia.org',
+ ),
+ array(
+ 'name' => 'Chad Horohoe',
+ 'email' => 'chad@wikimedia.org',
+ ),
+ ),
+ 'description' => 'Constant Database (CDB) wrapper library for PHP. Provides pure-PHP fallback when dba_* functions are absent.',
),
'cssjanus/cssjanus' => array(
'version' => '1.1.1',
'type' => 'library',
+ 'licenses' => array( 'Apache-2.0' ),
+ 'authors' => array(),
+ 'description' => 'Convert CSS stylesheets between left-to-right and right-to-left.',
),
'leafo/lessphp' => array(
'version' => '0.5.0',
'type' => 'library',
+ 'licenses' => array( 'MIT', 'GPL-3.0' ),
+ 'authors' => array(
+ array(
+ 'name' => 'Leaf Corcoran',
+ 'email' => 'leafot@gmail.com',
+ 'homepage' => 'http://leafo.net',
+ ),
+ ),
+ 'description' => 'lessphp is a compiler for LESS written in PHP.',
),
'psr/log' => array(
'version' => '1.0.0',
'type' => 'library',
+ 'licenses' => array( 'MIT' ),
+ 'authors' => array(
+ array(
+ 'name' => 'PHP-FIG',
+ 'homepage' => 'http://www.php-fig.org/',
+ ),
+ ),
+ 'description' => 'Common interface for logging libraries',
),
'oojs/oojs-ui' => array(
'version' => '0.6.0',
'type' => 'library',
+ 'licenses' => array( 'MIT' ),
+ 'authors' => array(),
+ 'description' => '',
),
'composer/installers' => array(
'version' => '1.0.19',
'type' => 'composer-installer',
+ 'licenses' => array( 'MIT' ),
+ 'authors' => array(
+ array(
+ 'name' => 'Kyle Robinson Young',
+ 'email' => 'kyle@dontkry.com',
+ 'homepage' => 'https://github.com/shama',
+ ),
+ ),
+ 'description' => 'A multi-framework Composer library installer',
),
'mediawiki/translate' => array(
'version' => '2014.12',
'type' => 'mediawiki-extension',
+ 'licenses' => array( 'GPL-2.0+' ),
+ 'authors' => array(
+ array(
+ 'name' => 'Niklas Laxström',
+ 'email' => 'niklas.laxstrom@gmail.com',
+ 'role' => 'Lead nitpicker',
+ ),
+ array(
+ 'name' => 'Siebrand Mazeland',
+ 'email' => 's.mazeland@xs4all.nl',
+ 'role' => 'Developer',
+ ),
+ ),
+ 'description' => 'The only standard solution to translate any kind of text with an avant-garde web interface within MediaWiki, including your documentation and software',
),
'mediawiki/universal-language-selector' => array(
'version' => '2014.12',
'type' => 'mediawiki-extension',
+ 'licenses' => array( 'GPL-2.0+', 'MIT' ),
+ 'authors' => array(),
+ 'description' => 'The primary aim is to allow users to select a language and configure its support in an easy way. Main features are language selection, input methods and web fonts.',
),
), $lock->getInstalledDependencies(), false, true );
}