* External libraries installed via composer will now be displayed
on Special:Version in their own section. Extensions or skins that are
installed via composer will not be shown in this section as it is assumed
- they will add the proper credits to the skins or extensions section.
+ they will add the proper credits to the skins or extensions section. They
+ can also be accessed through the API via the new siprop=libraries to
+ ApiQuerySiteInfo.
* Update QUnit from v1.14.0 to v1.16.0.
* Update Moment.js from v2.8.3 to v2.8.4.
* Special:Tags now allows for manipulating the list of user-modifiable change
log entry is not implemented yet.
* list=tags has additional properties to indicate 'active' status and tag
sources.
+* siprop=libraries was added to ApiQuerySiteInfo to list installed external libraries.
=== Action API internal changes in 1.25 ===
* ApiHelp has been rewritten to support i18n and paginated HTML output.
case 'usergroups':
$fit = $this->appendUserGroups( $p, $params['numberingroup'] );
break;
+ case 'libraries':
+ $fit = $this->appendInstalledLibraries( $p );
+ break;
case 'extensions':
$fit = $this->appendExtensions( $p );
break;
return $this->getResult()->addValue( 'query', $property, $data );
}
+ protected function appendInstalledLibraries( $property ) {
+ 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 true;
+ }
+ }
+
+ $data = array();
+ $lock = new ComposerLock( $path );
+ 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;
+ }
+ $data[] = array(
+ 'name' => $name,
+ 'version' => $info['version'],
+ );
+ }
+ $this->getResult()->setIndexedTagName( $data, 'library' );
+
+ return $this->getResult()->addValue( 'query', $property, $data );
+
+ }
+
protected function appendExtensions( $property ) {
$data = array();
foreach ( $this->getConfig()->get( 'ExtensionCredits' ) as $type => $extensions ) {
'dbrepllag',
'statistics',
'usergroups',
+ 'libraries',
'extensions',
'fileextensions',
'rightsinfo',
"apihelp-query+search-example-generator": "Ger page info about the pages returned for a search for <kbd>meaning</kbd>.",
"apihelp-query+siteinfo-description": "Return general information about the site.",
- "apihelp-query+siteinfo-param-prop": "Which information to get:\n;general:Overall system information.\n;namespaces:List of registered namespaces and their canonical names.\n;namespacealiases:List of registered namespace aliases.\n;specialpagealiases:List of special page aliases.\n;magicwords:List of magic words and their aliases.\n;statistics:Returns site statistics.\n;interwikimap:Returns interwiki map (optionally filtered, optionally localised by using <var>$1inlanguagecode</var>).\n;dbrepllag:Returns database server with the highest replication lag.\n;usergroups:Returns user groups and the associated permissions.\n;extensions:Returns extensions installed on the wiki.\n;fileextensions:Returns list of file extensions allowed to be uploaded.\n;rightsinfo:Returns wiki rights (license) information if available.\n;restrictions:Returns information on available restriction (protection) types.\n;languages:Returns a list of languages MediaWiki supports (optionally localised by using <var>$1inlanguagecode</var>).\n;skins:Returns a list of all enabled skins (optionally localised by using <var>$1inlanguagecode</var>, otherwise in the content language).\n;extensiontags:Returns a list of parser extension tags.\n;functionhooks:Returns a list of parser function hooks.\n;showhooks:Returns a list of all subscribed hooks (contents of <var>[[mw:Manual:$wgHooks|$wgHooks]]</var>).\n;variables:Returns a list of variable IDs.\n;protocols:Returns a list of protocols that are allowed in external links.\n;defaultoptions:Returns the default values for user preferences.",
+ "apihelp-query+siteinfo-param-prop": "Which information to get:\n;general:Overall system information.\n;namespaces:List of registered namespaces and their canonical names.\n;namespacealiases:List of registered namespace aliases.\n;specialpagealiases:List of special page aliases.\n;magicwords:List of magic words and their aliases.\n;statistics:Returns site statistics.\n;interwikimap:Returns interwiki map (optionally filtered, optionally localised by using <var>$1inlanguagecode</var>).\n;dbrepllag:Returns database server with the highest replication lag.\n;usergroups:Returns user groups and the associated permissions.\n;libraries:Returns libraries installed on the wiki.\n;extensions:Returns extensions installed on the wiki.\n;fileextensions:Returns list of file extensions allowed to be uploaded.\n;rightsinfo:Returns wiki rights (license) information if available.\n;restrictions:Returns information on available restriction (protection) types.\n;languages:Returns a list of languages MediaWiki supports (optionally localised by using <var>$1inlanguagecode</var>).\n;skins:Returns a list of all enabled skins (optionally localised by using <var>$1inlanguagecode</var>, otherwise in the content language).\n;extensiontags:Returns a list of parser extension tags.\n;functionhooks:Returns a list of parser function hooks.\n;showhooks:Returns a list of all subscribed hooks (contents of <var>[[mw:Manual:$wgHooks|$wgHooks]]</var>).\n;variables:Returns a list of variable IDs.\n;protocols:Returns a list of protocols that are allowed in external links.\n;defaultoptions:Returns the default values for user preferences.",
"apihelp-query+siteinfo-param-filteriw": "Return only local or only nonlocal entries of the interwiki map.",
"apihelp-query+siteinfo-param-showalldb": "List all database servers, not just the one lagging the most.",
"apihelp-query+siteinfo-param-numberingroup": "Lists the number of users in user groups.",