我的项目自动化部署依赖于Composer来安装所有依赖项。
每次部署时,部署脚本都要求重新安装,但是composer.lock总是相同的,部署之间没有依赖关系的变化。
从缓存加载版本号("twig/twig": "1.12.*")时引用的Librairies。但是,使用分支/提交引用("dompdf/dompdf" : "dev-master#424c235")的方法总是会触发git克隆到GitHub。
至于其他库,这些版本没有改变,但没有从缓存中加载。
Loading composer repositories with package information
Installing dependencies from lock file
- Installing phenx/php-font-lib (0.2.1)
Loading from cache
- Installing dompdf/dompdf (dev-master 424c235)
Cloning 424c235
- Installing endroid/qrcode (dev-master 4eb83c9)
Cloning 4eb83c9
- Installing j4mie/idiorm (v1.3.0)
Loading from cache
- Installing j4mie/paris (v1.3.0)
Loading from cache
- Installing jamesiarmes/php-ews (master edbcb65)
Cloning edbcb65
- Installing symfony/process (v2.3.1)
Loading from cache
- Installing kriswallsmith/assetic (dev-master 0a55a9b)
Cloning 0a55a9b
- Installing kriswallsmith/buzz (v0.10)
Loading from cache
- Installing psr/log (1.0.0)
Loading from cache
- Installing monolog/monolog (1.5.0)
Loading from cache
- Installing mtdowling/cron-expression (v1.0.1)
Loading from cache
- Installing respect/validation (0.4.4)
Loading from cache
- Installing ruudk/twitter-oauth (dev-master a4c0094)
Cloning a4c0094
- Installing slim/slim (2.2.0)
Loading from cache
- Installing slim/extras (2.0.1)
Loading from cache
- Installing symfony/console (v2.2.2)
Loading from cache
- Installing tedivm/jshrink (v0.5.1)
Loading from cache
- Installing twig/twig (v1.12.3)
Loading from cache
- Installing zendframework/zend-stdlib (2.1.5)
Loading from cache
- Installing zendframework/zend-authentication (2.1.5)
Loading from cache
- Installing zendframework/zend-permissions-acl (2.1.5)
Loading from cache
- Installing zendframework/zend-session (2.1.5)
Loading from cacheTL;DR;
如何使Composer从本地缓存获取提交所引用的依赖项?
发布于 2014-01-09 23:35:43
不要克隆从Github,而是下载ZIPs。当您更新时,标志--prefer-dist将触发此操作。如果没有此操作,则该包没有缓存条目,只有vendor文件夹中的克隆爬虫会输入任何更改,然后检出所需的提交id。
https://stackoverflow.com/questions/21023918
复制相似问题