2016-07-19 4 views
0

Ich arbeite mit Symfony 2.8 und stehe auf einige Probleme beim Start eines einfachen composer update-Befehls.Warum benötigt ein Composer-Update Zugriff auf die Datenbank?

Dieser Fehler tritt in meiner Entwicklungsumgebung auf. Ich benutze eine vagabundierende virtuelle Maschine. Hier ist der Fehler:

[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 

Natürlich ist dies geschieht, wenn ich den Befehl auf meiner Host-Maschine zu starten. PHP kann keine Verbindung zur Datenbank herstellen, da mein Host-Computer keine hat. Das ist also ein normales Verhalten.

Der Befehl funktioniert gut, wenn ich ssh in meine VM.

So könnte ich hier aufhören und nur meine Abhängigkeiten von meiner VM aktualisieren.

Allerdings möchte ich keine composer update auf meine Datenbank zugreifen, und ich sehe nicht, warum es es brauchen würde.

Wo soll ich suchen oder welche Informationen könnte ich Ihnen geben, um mir zu helfen, mein Problem zu lösen?

EDIT: Hier ist meine composer.json Datei:

{ 
    "name": "root/blog", 
    "license": "proprietary", 
    "type": "project", 
    "autoload": { 
     "psr-4": { 
      "": "src/", 
      "SymfonyStandard\\": "app/SymfonyStandard/" 
     } 
    }, 
    "require": { 
     "php": ">=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": "[email protected]", 
     "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" 
     } 
    } 
} 

Antwort

5

Seit Lehre 2.5, Dctrine\DBAL\Connection::detectDatabasePlatform() auf viele Befehle aufgerufen und wird einen Aufruf an die Datenbank (Ausgabe hier: https://github.com/doctrine/dbal/issues/990) ausstellen.

dieses Problem umgehen, DB-Version in Lehre Konfiguration einzustellen:

doctrine: 
    dbal: 
     default_connection: default 
     connections: 
      default: 
       server_version: 5.6 
+0

Funktioniert prima, vielen Dank! Schande über mich Ich habe das Problem nicht selbst gefunden: / – Hammerbot