缓慢更新作曲家依赖项,尽管--prefer-dist标志 [英] Slow updating of composer dependencies, despite --prefer-dist flag
问题描述
为什么我的作曲家依赖关系最多需要两分钟才能更新 - 即使没有任何更改。
Why does it take up to two minutes for my composer dependencies to update - even when there have been no changes?
A heavily upvoted answer 建议添加 - prefer-dist
标志,我已附加到我的命令:
A heavily upvoted answer suggests adding the --prefer-dist
flag, which I have appended to my command:
php composer.phar update --prefer-dist
但这没有什么区别。下面是我的composer.json文件 - 我做了什么傻的?
But this makes no difference. Below is my composer.json file - have I done something silly?
{
"name": "my-namespace/symfony",
"type": "project",
"description": "",
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"sensio/distribution-bundle": "2.2.*",
"my-namespace/my-bundle": "1.0.*"
},
"repositories": [
{
"type": "vcs",
"url": "http://username:password@git.com/my-bundle.git"
}
],
"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"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
推荐答案
这个问题通常与 xdebug
lodaed有关不是)在CLI环境中。
This problem is often related to xdebug
lodaed (doesn't matter if enabled or not) in your CLI environment.
您可以使用以下命令检查是否为CLI启用了xdebug:
You can check wether xdebug is enabled for CLI using:
// unix
php -m | grep xdebug
// windows
php -m | findstr xdebug
更多信息可以通过启用最大详细程度和分析信息获得这么长时间的操作: / p>
Further information what operations take so long can be gained by enabling maximum verbosity and profiling information:
composer install --prefer-dist -vvv --profile
或
composer update --prefer-dist -vvv --profile
这篇关于缓慢更新作曲家依赖项,尽管--prefer-dist标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!