Composer extremely slow and inconsistent

1

Some days I'm having a problem with my composer that does not make much sense (it does not have a default / default logic, the errors are almost random), so I'm not able to solve it, what happens is as follows

I have a mini framework, and I'm updating it as I need the resources, the steps are as follows:

1 - I access the framework.

2 - I push on github.

3 - I update the packagist.

4 - I update the composer in the project that I'm using it (This step is the problem)

If I indicate to update only the dependency in question, it works correctly, but if I give the command 'composer update' it removes some dependencies (sometimes all) and installs again, and it does not update autoloader if the 'vendor/composer' folder is not deleted, and to complicate it, this process of the update command is taking more than 20 minutes, causing several alerts like this.

exceeded the timeout of 300 seconds.

But this update of the dependencies are not consistent, that is, they are not the same ones that always update, each time is different.

List of dependencies requesting update without having been modified more often:

PHPDocumentor (This is the one that takes the most time and the updates are inconsistent)

Synfony

Doctrine

Guzzlehttp

robinherbots / jquery.inputmask (This updates 100% of the time and takes a long time)

cocur / slugify

components / jquery

zendframework

And when each of these dependencies have other dependencies, they are also 100% up-to-date, taking a long time to complete, failing to alert and / or not completing.

And the second problem is the issue of updating github/gitlab within composer .

If the autoload file is updated to include some vendor new, and is given update command, it does the whole process, indicates success, but does not include the new composer.json in namespace , so that this step I need to delete the folder namespace give the command autoload and wait + - 20 minutes (has already reached more than 40) to update everything and I can go back to work.

Additional information:

  

Test: Ubuntu OS 16.4

     

Production: Debian OS 7.

     

PHP: 7. GIT: Last version.

     

Permissions for the 777 folders.

     

IDE: Netbeans 8.2

     

Broadband Internet 50MB Stable.

composer.json

  {
    "name": "contabil app center",
    "description": "",
    "type": "Biblioteca",
    "license": "BSD-3",
    "version": "1.0",
    "authors": [
        {
            "name": "Gabriel",
            "email": ""
        }
    ],
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.3.8",  
        "guzzlehttp/guzzle": "~6.0",
        "slim/pdo": "~1.9",
        "cocur/slugify": "dev-master",
        "components/jquery": "~3.2.1",
        "wixel/gump": "dev-master",
        "phpmailer/phpmailer": "^5.2",
        "easy-cont/vidb": "dev-master",
        "phpdocumentor/phpdocumentor": "2.*"
    },
    "autoload": {
        "psr-4": {

            "appModel\": "model/app",
            "appView\": "view/app",
            "appController\": "controller/app",
            "appFinancialRestatement\":"model/app/calculations/financial-calculations",
            "appFinancialIndices\":"model/app/calculations/financial-calculations",
            "appDebitWorksheet\":"model/app/calculations/financial-calculations",
            "appFIPE\":"model/app/fipe",
            "phpToJs\":"interactors",
            "siteModel\": "model/site",
            "indexView\": "view/site",
            "siteController\": "controller/site"
        }
    }
}
    
asked by anonymous 14.08.2017 / 19:42

1 answer

1

Possible causes of error:

1. Network issues:

As the question below may be a problem with IPV6, perhaps it is Linux, I do not know if the problem occurs in Windows:

It can also be a problem with Firewall or Proxy on the network, one of these two can not formulate a "standard" response, because each network can work in a way.

2. Xdebug or similar active in CLI

The composer is PHP in CLI (command line interface), using XDebug in it or similar extensions can cause problems of the type, I recommend that I create a php.ini for the CLI and another for Apache (if it is linux already is separate) and then in php.ini for CLI just comment the line of all possible extensions that you use to debug as I explained in this answer:

3. Outdated composer

It could be a bug in the version of composer , or maybe that was how it worked in old versions, downloading everything again, in case you can first check the current composer version with the command:

composer -V
  

Note: V is capitalized

Or the command:

composer -about

The most current version is 1.5.1 , if it is less than this it is necessary to update, for this use the command:

composer self-update

If the command does not work, it should really be using a very old version , so it will only be able to update manually, being Linux I can not tell where it was installed because this is the user's option machine, if you know where the file composer.phar removes it and install again:

Download the setup:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

And then run the setup:

php composer-setup.php

Installing Composer Globally on Linux

In Linux the composer is not installed globally, but you can copy move manually, after downloading you can do this according to the response of the Wallace :

chmod +x composer.phar
mv composer.phar /usr/local/bin/composer

Or, depending on the answer Daniel edit .bashrc and add: / p>

alias composer=/a/pasta/onde/esta/conposer.phar
    
14.08.2017 / 21:23