SpecialVersion:
$paths = [ MW_INSTALL_PATH . '/vendor/composer/installed.json' ]; $extensionTypes = self::getExtensionTypes(); foreach ( $extensionTypes as $type => $message ) { if ( !isset( $credits[$type] ) || $credits[$type] === [] ) { continue; } foreach ( $credits[$type] as $extension ) { if ( !isset( $extension['path'] ) ) { continue; } $paths[] = dirname( $extension['path'] ) . '/vendor/composer/installed.json'; } } $dependencies = []; foreach ( $paths as $path ) { if ( !file_exists( $path ) ) { continue; } $installed = new ComposerInstalled( $path ); $dependencies += $installed->getInstalledDependencies(); } if ( $dependencies === [] ) { return ''; } ksort( $dependencies );
ApiQuerySiteInfo
$path = MW_INSTALL_PATH . '/vendor/composer/installed.json'; if ( !file_exists( $path ) ) { return true; } $data = []; $installed = new ComposerInstalled( $path ); foreach ( $installed->getInstalledDependencies() as $name => $info ) { if ( str_starts_with( $info['type'], 'mediawiki-' ) ) { // Skip any extensions or skins since they'll be listed // in their proper section continue; } $data[] = [ 'name' => $name, 'version' => $info['version'], ]; } ApiResult::setIndexedTagName( $data, 'library' );