2013-09-25 46 views
3

我使用composer主要是为了管理git存储库(本地和远程)。 Composer在所有历史提交中读取composer.json的每个标记实例:作曲家:只扫描标签名称,而不是整个composer.json

Reading composer.json of tomekwi/composer-installers (v1.0.0) 
Importing tag v1.0.0 (1.0.0.0) 
Reading composer.json of tomekwi/composer-installers (v1.0.1) 
Importing tag v1.0.1 (1.0.1.0) 
Reading composer.json of tomekwi/composer-installers (v1.0.2) 
Importing tag v1.0.2 (1.0.2.0) 
Reading composer.json of tomekwi/composer-installers (v1.0.3) 
Importing tag v1.0.3 (1.0.3.0) 
Reading composer.json of tomekwi/composer-installers (v1.0.4) 
Importing tag v1.0.4 (1.0.4.0) 
Reading composer.json of tomekwi/composer-installers (v1.0.5) 
Importing tag v1.0.5 (1.0.5.0) 
Reading composer.json of tomekwi/composer-installers (v1.0.6) 
Importing tag v1.0.6 (1.0.6.0) 
Reading composer.json of tomekwi/composer-installers (1.x) 
Importing branch 1.x (1.x-dev) 

...etc 

需要较长的存储库时间。另外它会导致与github问题(https://circleci.com/docs/composer-api-rate-limit

如果我理解正确,其目的是从每个composer.json文件中提取版本号。如果作曲家通过阅读标签名称来选择正确的版本,速度会更快。请求"tomekwi/composer-installers": "~1.0"看起来是这样的:

Reading tags of tomekwi/composer-installers 
    - Picked matching tag (v1.0.6) 
Reading composer.json of tomekwi/composer-installers (v1.0.6) 
    - Installing tomekwi/composer-installers (v1.0.6) 

..和采取半秒,而不是半分钟。

有没有可能这样做?

回答

2

作曲家不知道存储库内的包是什么。所以它必须阅读composer.json找出。

由于软件可以重命名,因此不能保证存储库中找到的每个标签都属于相同的软件包名称。

您应该看看托管Packagist或Satis的本地实例。这些工具扫描您的存储库并获取Composer工作所需的信息。 Satis也可能将找到的标签转储到ZIP文件中,这也加快了安装过程(从本地服务器解压下载的文件通常比克隆repo更快)。

相关问题