2

I'm developing some libraries i frequently use across more than one project and i use GIT to version them.

Now, i'd like to use them through Composer.

Here comes my question: Composer makes me able to specify some private repositories from which i can pull source code to include in my apps (https://getcomposer.org/doc/05-repositories.md#using-private-repositories).

Then, i found Satis: https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md#satis

Now, i don't well understand the differences between the two and which advantages i can have using Satis instead of using the private repositories through the Composer capabilities.

Should i really have to setup a Setis server? Which advantages does it bring to me?

4

1 回答 1

4

默认情况下,从名为Packagist的特殊公共包存储库中Composer查找依赖项。 存储每个添加的存储库位置及其依赖项。当您运行时,会询问依赖项及其位置,然后下载它们。composer.jsonPackagistcomposer installComposerPackagist

但是当你有一个非常大的项目时,有很多依赖项,或者(并且)你正在相当频繁地构建你的项目,那么你很快就会遇到两个问题。

第一个也是主要的问题是速度。如果您没有广泛的互联网连接,那么由团队的所有成员同时构建您的应用程序可能需要大量时间

第二个问题是公共存储库托管服务Github通常对 api 请求有限制

您可以通过在本地基础架构中设置镜像来解决这两个问题。在这种情况下,不会去找您的依赖项,而是向您的服务器询问它们。PackagistSatisComposerPackagistSatis

Packagist是一项公共服务,但有时您希望将另一个私有存储库添加为依赖项。您可以添加一个特殊条目,composer.json以便Composer从其他位置下载此包。如果您愿意,您还可以Satis像使用公共存储库一样镜像您的私有存储库。

于 2015-01-26T21:07:40.087 回答