为什么 Composer 中的依赖项更新如此缓慢? [英] Why updating of dependencies in composer is so slow?

查看:36
本文介绍了为什么 Composer 中的依赖项更新如此缓慢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 composer (http://getcomposer.org/) 来管理 Symfony2 中已安装的包(symfony v 2.1.3).作曲家的版本是 de3188c.

I am using composer (http://getcomposer.org/) to manage installed bundles in the Symfony2 (symfony v 2.1.3). Version of the composer is de3188c.

我遇到的问题是,当我将新包添加到 composer.json 并执行它时,显示有关更新依赖项和下一次下载它们的消息的时间非常低.

I have problem that when I add new bundle into the composer.json and execute it the time to show messages about Updating dependencies and next downloading them all is very low.

我在 composer.json 中有这些数据(见下文),执行时间大约是 20 分钟!!!互联网连接速度足够快,我可以非常快地下载大文件...

I have this data in the composer.json (see below) and the executing time is approximately 20 MINUTES!!! The internet connection is fast enough I can download big files very fast...

有什么技巧可以让它更快?

Is there any trick to make it faster?

{
"name": "symfony/framework-standard-edition",
"description": "The "Symfony Standard Edition" distribution",
"autoload": {
    "psr-0": { "": "src/" }
},
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.1.*",
    "doctrine/orm": ">=2.2.3,<2.4-dev",
    "doctrine/doctrine-bundle": "1.0.*",
    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.1.*",
    "symfony/swiftmailer-bundle": "2.1.*",
    "symfony/monolog-bundle": "2.1.*",
    "sensio/distribution-bundle": "2.1.*",
    "sensio/framework-extra-bundle": "2.1.*",
    "sensio/generator-bundle": "2.1.*",
    "jms/security-extra-bundle": "1.2.*",
    "jms/di-extra-bundle": "1.1.*",
    "doctrine/doctrine-fixtures-bundle": "dev-master",
    "webignition/doctrine-migrations-bundle": "dev-master"
},
"scripts": {
    "post-install-cmd": [
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile"
    ],
    "post-update-cmd": [
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile"
    ]
},
"minimum-stability": "dev",
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web"
}

推荐答案

尝试在composer.json中为每个依赖指定一个版本,调用composer时使用选项--prefer-dist.它将从存储库(如果可用)而不是单个文件下载 ZIP 文件.

Try to specify a version for each dependency in composer.json and use the option --prefer-dist when calling composer. It will download ZIP files from the repositories (if available) instead of the single files.

php composer.phar install --prefer-dist

这篇关于为什么 Composer 中的依赖项更新如此缓慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆