Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the PHP Composer Repository Protocol Defined?

In composer, PHP's package management system, its possible to configure a repository. A repository is a system that composer will "ask" when it needs to find a package. i.e.

Composer: Hey, repository, where can I find the foo/bar package

Repository: You can find foo/bar (in this VCS repository|in this dist zip file)

By default, composer will look at the packagist.org repository when it wants to find something.

Are the technical details (i.e. a protocal) of the above plain english description defined anywhere? Or, put a different way, is there a description of the packages.json schema file anywhere?

The documentation is a little scant on this, saying only

The main repository type is the composer repository. It uses a single packages.json file that contains all of the package metadata.

And even this is (in certain contexts) inaccurate, as a packages.json file can include other json files to avoid a super large packages.json.

Is this a well defined protocol, or is this a case of the composer source being the only source of truth on how a "composer repository" should behave?

like image 610
Alan Storm Avatar asked Apr 02 '16 19:04

Alan Storm


1 Answers

Take a lookt satis. It is a open-source Package Repository Generator for Composer. It generates a Composer Repository file. That file will hopefully tell you more about the packages.json schema. It is indeed a bit weird that Composer doesn't have a good description about this on their website.

like image 78
Laurens Avatar answered Sep 19 '22 17:09

Laurens