Why is compiler dependency updating so slow?

I use composer ( http://getcomposer.org/ ) to manage installed packages in Symfony2 (symfony v 2.1.3). Composer version de3188c .

I have a problem with the fact that when I add a new set to the .json composer and execute it, it’s time to show dependency update messages and the next load is very low.

I have this data in composer.json (see below), and the runtime is approximately 20 MINUTES !!! Internet connection is fast enough, I can quickly download large files ...

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" } 
+61
dependencies symfony composer-php
Nov 16 '12 at 9:31
source share
4 answers

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

 php composer.phar install --prefer-dist 
+70
Nov 16 '12 at 9:37
source share

Since you accepted the answer, it looks like this solved your problem. Just in case, someone else comes across this issue (for example, when I searched), in my case, a very slow installation of Composer was related to my version of PHP (a word of warning, I'm a complete and complete Composer newbie), although the composer passed standard checks and said that everything is in order. I am running Ubuntu 12.04 LTS and was too lazy to upgrade from PHP 5.3.10 by default (the same version you are working on) in Precise repo.

Installing Twig through Composer initially took me about 30 minutes. I refused to install the Doctrine after it took more than an hour. I upgraded to 5.4.17 (using this PPA https://launchpad.net/~ondrej/+archive/php5 ) and the installation of Doctrine was completed in seconds.

+20
Jul 25 '13 at 0:32
source share

I found that it is also very slow, tens of minutes slow.

For me, I added -vvv and found that it hangs on things like Downloading https://packagist.org/p/provider-active$53cdf887c8d2925b3501f47d6980fb7bda2310716369bf7a84857c6e62bbab0f.json

Then I went to the browser and tried to download this JSON file and, of course, enough. It was packagist.org, which caused slowness.

+14
Aug 05 '14 at
source share

In my case, the above suggestions did not affect. What should be used for the HTTPS for packagist :

 php composer.phar config --global repo.packagist composer https://packagist.org 

or

 composer config --global repo.packagist composer https://packagist.org 

depending on your setting

+8
Jul 07 '15 at 1:43
source share



All Articles