且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Composer嵌套的依赖项和私有存储库

更新时间:2023-11-16 22:52:40

您正确地发现,只有根软件包才能将存储库元数据添加到已知软件包的集合中.

As you correctly found out, only the root package can add repository metadata to the collection of known packages.

我建议您看看 Satis 来创建本地Composer存储库.这仅需要您将此单一存储库添加到所有软件包的所有 composer.json 文件中,它将用作有关所有私有存储库的可更新知识来源.您不再需要在任何地方添加Git存储库列表.

I would suggest you take a look at Satis to create a local Composer repository. This would only require you to add this single repository to all your composer.json files of all packages, and it will be used as an updatable source of knowledge about all your private repositories. You no longer have to add a list of Git repos everywhere.

我已经成功地为我们的IT企业托管了大约120个内部软件包.以此为标志,一旦开始将孤立的任务拆分为一个程序包,您将很快获得更多任务.

I am successfully hosting around 120 internal packages for our IT enterprise that way. Take this as a sign that once you start splitting isolated tasks into a package, you will get more of them pretty fast.

还请注意,认真对待版本控制很重要.停止依赖分支机构-标记软件,发布版本,使用语义版本控制.如果您不这样做,事情会在某些时候破裂,人们会因为您无法使用或弄乱事情而诅咒您(正确)或Composer(错误).

Also note that it is important to take versioning seriously. Stop depending on branches - tag your software, make releases, use semantic versioning. If you don't, things will break at some point, and people will curse you (correct) or Composer (incorrect) for not working or messing things up.