Skip to content

Composer/Packagist compatible API #3

@pierrejoye

Description

@pierrejoye

For example:

. https://github.com/KnpLabs/packagist-api should work out of the box when using pickleweb

For what packagist does:
Quote from a discussion with Jordi:

It all starts with:

https://packagist.org/packages.json

Then provider-includes define a list of provider listings, e.g.:

p/provider-2013$%hash%.json: {
sha256: "41baf880b781a44db23b1e880f014e25cdc59939b381deb38f8d52d5a74ef717"
},

can be queried at:

https://packagist.org/p/provider-2013$41baf880b781a44db23b1e880f014e25cdc59939b381deb38f8d52d5a74ef717.json

And inside that, every provider like:

0x20h/monoconf: {
sha256: "b5bc3eac62b9f38814b140be994c268b7c1f3d9d32bea4dfc53ca15def1f27e1"
},

Can be found at the url defined by providers-url in the main file, i.e.:

https://packagist.org/p/0x20h/monoconf$b5bc3eac62b9f38814b140be994c268b7c1f3d9d32bea4dfc53ca15def1f27e1.json

And providers can also be found at just the package name without hash, which might be useful eventually so it's best if you also do it I guess:

That URL is hardcoded to /p/%name%.json

https://packagist.org/p/0x20h/monoconf.json

It's all done in https://github.com/composer/packagist/blob/master/src/Packagist/WebBundle/Package/SymlinkDumper.php for reference.

--- end of the quote

It should be done in a similar way but maybe simpler, from a tree structure point of view.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions