首页 文章

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

提问于
浏览
2

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

是否有一个composer.json配置使用与Symfony的doctrine 2.4?我找不到有效的依赖列表 . 如果我在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 回答

  • 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",
    

相关问题