Page MenuHomePhabricator

Vendored libraries included from extension folders don't appear on Special:Version
Closed, ResolvedPublic

Description

In the midst of testing https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/WebAuthn/+/508788/...

Rather than altering my checkout of mediawiki-vendor, I just ran composer in the extension dir and relied on load_composer_autoloader in the extensions extension.json doing its job

While the classes are loaded

> var_dump( class_exists( 'Webauthn\\AttestedCredentialData' ) );
/var/www/wiki/mediawiki/core/maintenance/eval.php(78) : eval()'d code:1:
bool(true)

Their library definitions don't appear on Special:Version

I guess, based on the code this is intentional..

		global $IP;
		$path = "$IP/vendor/composer/installed.json";
		if ( !file_exists( $path ) ) {
			return '';
		}

		$installed = new ComposerInstalled( $path );

But it would definitely be nice to have this information, and as it should exist from registration as long as we keep track of the various installed.json...

As they're still installed libraries (and load_composer_autoloader is a supported method) even if they're just obfuscated a bit hiding under an extension directory

Event Timeline

Reedy created this task.Aug 7 2019, 5:28 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 7 2019, 5:28 PM
Reedy renamed this task from Vendored libraries included from extension folders don't seemingly appear on Special:Version to Vendored libraries included from extension folders don't appear on Special:Version.Aug 7 2019, 5:28 PM

Change 541364 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Include libraries loaded via load_composer_autoloader on Special:Version

https://gerrit.wikimedia.org/r/541364

Change 541364 merged by jenkins-bot:
[mediawiki/core@master] Include libraries loaded via load_composer_autoloader on Special:Version

https://gerrit.wikimedia.org/r/541364

Reedy closed this task as Resolved.Nov 1 2019, 6:15 PM
Reedy claimed this task.
Reedy triaged this task as Medium priority.