Support any composer-type repository
See original GitHub issueI tried to use this plugin to connect to Packagist (ok) and to Drupal 8 composer repository (ko).
After a small investigation, the plugin tries to download the file packages/list.json and this file seems to be a specificity of packagist.org.
The packages.json file contains the links to the provider files. The provider files contains the list of the packages and their signatures.
The provider files are the ones used by composer.
The packages/list.json has the list of the available packages of packagist.org but it looks like it’s not used at all by composer, nor it’s provided by Drupal 8’s repository.
To solve this issue, we should :
- update the method
generatePackagesJsonin the classComposerProxyFacetImplto only use the providers - don’t use the constant
PROVIDER_JSONin theComposerProxyFacetImplclass, instead use the value provided by thepackages.jsonfile - handle the case when a provider is not available anymore (it seems to be the case for old versions of providers)
Some technical details
The entry point is the packages.json file.
Examples :
- for Packagist : https://packagist.org/packages.json
- for Drupal : https://packages.drupal.org/8/packages.json
The packages.json file contains a providers-url and a provider-includes entries.
The providers-includes entry list all the files containing the list of repositories.
Examples :
- for Packagist :
p/provider-2018-01$%hash%.jsonwith hash9e9bb7cf12c2f46329fde5008d3ce061405ff7d1e88150e64e98fc4df8b46b7bthat will be transformed to https://packagist.org/p/provider-2018-01$9e9bb7cf12c2f46329fde5008d3ce061405ff7d1e88150e64e98fc4df8b46b7b.json - for Drupal :
drupal/provider-2018-1$%hash%.jsonwith hashf0bc8344a8c5af51478a86cc24911a2e36441b92a88085f534445b2531aabb7bthat will be transformed to https://packages.drupal.org/8/drupal/provider-2018-1$4d04d5677c5045740aa28bd346e9889c2bd0d5ea23a2c71ef132585be9952777.json
The providers-url contain the format to use to download the description of a specific package.
The required informations (%package% and %hash%) are available in the provider file described above.
Examples :
- for Packagist :
/p/%package%$%hash%.json, with the packagefaustbrian/ark-symfonyand its hash52b4cbe41a74b0c787f853f9c5522caa764c4e20fe660ade907af46d35f5c0f2: https://packagist.org/p/faustbrian/ark-symfony$52b4cbe41a74b0c787f853f9c5522caa764c4e20fe660ade907af46d35f5c0f2.json - for Drupal :
/8/%package%$%hash%.json, with the packagedrupal/tokenand its hash0e905c202a67a1b2a08bbd6da858b8af93c01ec6d06dd8f3488b318acfe5680c: https://packages.drupal.org/8/drupal/token$0e905c202a67a1b2a08bbd6da858b8af93c01ec6d06dd8f3488b318acfe5680c.json
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:8 (6 by maintainers)

Top Related StackOverflow Question
Hi, will this issue get some traction any time soon?
Still no news ?