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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With