2014-06-23 39 views
2

Doctrine 2.4在我目前的Symfony 2.3項目中有一些有趣的新功能。在Symfony和composer.json中使用Doctrine 2.4

是否有一個composer.json配置使用與Symfony準則2.4?我無法找到有效的依賴列表。如果我在我的composer.json中指定了2.4.3版本的doctrine/orm,那麼我得到了一個作曲者更新錯誤,因爲doctrine/doctrine-bundle不允許教義安裝> 2.3。

在Symfony2文檔中提到了2.4規範,但是我還沒有找到有效的composer.json列表。

任何幫助表示讚賞。

當前composer.json

{ 
    "name": "symfony/framework-standard-edition", 
    "description": "The \"Symfony Standard Edition\" distribution", 
    "autoload": { 
     "psr-0": { "": "src/" } 
    }, 
    "repositories": [ 
     { 
      "type": "vcs", 
      "url": "https://github.com/Fraktl/EscapeWSSEAuthenticationBundle.git" 
     } 
    ], 
    "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/swiftmailer-bundle": "2.3.*", 
     "symfony/monolog-bundle": "2.3.*", 
     "sensio/distribution-bundle": "2.3.*", 
     "sensio/framework-extra-bundle": "2.3.*", 
     "sensio/generator-bundle": "2.3.*", 
     "incenteev/composer-parameter-handler": "~2.0", 
     "stof/doctrine-extensions-bundle": "dev-master", 
     "friendsofsymfony/jsrouting-bundle": "~1.1", 
     "friendsofsymfony/rest-bundle": "dev-master", 
     "sprain/validator-bundle": "dev-master", 
     "willdurand/geocoder-bundle": "@stable", 
     "friendsofsymfony/user-bundle": "[email protected]", 
     "escapestudios/wsse-authentication-bundle": "2.3.x-dev", 
     "jms/serializer-bundle": "dev-master", 
     "doctrine/doctrine-fixtures-bundle": "2.2.*", 
     "luxifer/doctrine-functions": "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" 
    } 
} 
+0

請告訴我們您的composer.json – Nextar

+0

@Nextar加入composer.json – Simon

+0

也許更新你的Symfony到2.4。*有幫助。你也可以嘗試'「doctrine/orm」:「2.4。*」,' – Javad

回答

3

composer.json:

"require": { 
    "php": ">=5.3.3", 
    "symfony/symfony": "2.3.*", 
    "doctrine/orm": "2.4.*", 
    "doctrine/doctrine-bundle": "~1.2", 
    .... 

然後更新您的dependencys

$ composer update doctrine\orm 

但是!林不知道,如果是因爲symfony的主人正在使用相同版本的支持,因爲2.3(symfony的2.5 composer.json)

"require": { 
    "doctrine/orm": "~2.2,>=2.2.3", 
    "doctrine/doctrine-bundle": "~1.2", 
+0

升級到symfony 2.4的確有竅門。謝謝@nextar – Simon

+0

它不是升級symfony,它只是定義了2.4版的doctrine \ orm包。* – Nextar

+0

能夠添加doctrine/orm 2.4。*我還必須做「symfony/symfony」:「〜2.4」否則作曲家更新在教條/教條束上失敗。 – Simon