title: Why does a composer update need access to the database
body: <p>I am working with Symfony 2.8 and running into some issues launching a simple <code>composer update</code> command. </p>
  
  <p>This error comes on my development environment. I am using a vagrant virtual machine. Here is the error:</p>
  
  <pre><code>[Doctrine\DBAL\Exception\ConnectionException]                              
    An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused  
  
  
  
        [Doctrine\DBAL\Driver\PDOException]        
        SQLSTATE[HY000] [2002] Connection refused  
  
  
  
        [PDOException]                             
        SQLSTATE[HY000] [2002] Connection refused  
  
  
      Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
  </code></pre>
  
  <p>Of course, this is happening when I launch the command on my host machine. PHP cannot connect to the database because my host machine doesn't have any. So this is a normal behaviour. </p>
  
  <p>The command works well when I ssh into my VM. </p>
  
  <p>So I could stop here and just update my dependencies from my VM. </p>
  
  <p>However, I don't want a <code>composer update</code> to access my database, and I don't see why it would need it. </p>
  
  <p>Where should I look or what information could I give you to help me solve my problem? </p>
  
  <p>EDIT: Here is my <code>composer.json</code> file:</p>
  
  <pre><code>{
      "name": "root/blog",
      "license": "proprietary",
      "type": "project",
      "autoload": {
          "psr-4": {
              "": "src/",
              "SymfonyStandard\\": "app/SymfonyStandard/"
          }
      },
      "require": {
          "php": "&gt;=5.3.9",
          "symfony/symfony": "2.8.*",
          "doctrine/orm": "^2.4.8",
          "doctrine/doctrine-bundle": "~1.4",
          "symfony/assetic-bundle": "~2.3",
          "symfony/swiftmailer-bundle": "~2.3",
          "symfony/monolog-bundle": "~2.4",
          "sensio/distribution-bundle": "~4.0",
          "sensio/framework-extra-bundle": "^3.0.2",
          "incenteev/composer-parameter-handler": "~2.0",
          "jms/serializer": "^1.1",
          "gedmo/doctrine-extensions": "dev-master",
          "friendsofsymfony/user-bundle": "~2.0@dev",
          "setasign/fpdf": "^1.8",
          "picqer/php-barcode-generator": "^0.2.0",
          "oneup/flysystem-bundle": "^1.3",
          "itbz/fpdf": "^1.7",
          "milon/barcode": "^5.2"
      },
      "require-dev": {
          "sensio/generator-bundle": "~2.3"
      },
      "scripts": {
          "post-root-package-install": [
              "SymfonyStandard\\Composer::hookRootPackageInstall"
          ],
          "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",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
          ],
          "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",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
          ]
      },
      "config": {
          "bin-dir": "bin"
      },
      "extra": {
          "symfony-app-dir": "app",
          "symfony-web-dir": "web",
          "symfony-assets-install": "relative",
          "incenteev-parameters": {
              "file": "app/config/parameters.yml"
          }
      }
  }
  </code></pre>