将Doctrine 2.4与Symfony和composer.json一起使用

时间:2014-06-23 19:10:31

标签: php symfony doctrine-orm composer-php

Doctrine 2.4有一些有趣的新功能,我想在我目前的Symfony 2.3项目中使用。

是否有一个composer.json配置使用docmine 2.4和Symfony?我找不到有效的依赖列表。如果我在composer.json中指定了doctrine / orm的2.4.3版本,我会得到一个作曲家更新错误,因为doctrine / doctrine-bundle不允许doctrine install> 2.3。

Symfony2文档中提到了Doctrine 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": "~2.0@dev",
        "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"
    }
}

1 个答案:

答案 0 :(得分:3)

composer.json:

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

然后更新您的依赖项

$ composer update doctrine\orm

但是!我不确定,如果它是受支持的,因为symfony master从2.3开始使用相同的版本(symfony 2.5 composer.json)

"require": {
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
相关问题