1

我一切正常,我升级了我的 mac 上的 mac 端口以获取最新的软件包。它安装了 Mongo 2.4.1,我也得到了 boost @1.53.0_1+no_single+no_static+python27。现在,当我尝试在 Symfony 2 应用程序中使用相同的代码进行交互时,我得到:

Fatal error: Class 'Doctrine\MongoDB\Util\InvalidArgumentException' not found in /Users/saudfaisal/Sites/dailytamatar.com/vendor/doctrine/mongodb/lib/Doctrine/MongoDB/Util/ReadPreference.php on line 63

我的 composer.json 如下所示:

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.0.*",
        "twig/extensions": "1.0.*@dev",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "friendsofsymfony/user-bundle": "*",
        "friendsofsymfony/rest-bundle": "*",
        "jms/serializer-bundle": "*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*",
        "kriswallsmith/assetic": "1.1.*@dev",
        "doctrine/mongodb-odm-bundle": "3.0.*@dev"
    },  "minimum-stability": "stable",
    "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"
        ]
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web"
    }
}

我知道过去 boost 存在问题,必须回滚以 boost @1.49.0_0 但是这次没有用。

有人能帮助我吗?

4

1 回答 1

1

doctrine/mongodb这已在几个月前发布的软件包 1.0.2 版中得到修复。如果您想确认,实际提交是b317c8e 。

我建议明确要求doctrine/mongodb-odm并且可能doctrine/mongodb在您的composer.json文件中,而不是依赖捆绑包的内部依赖项。此外,您的composer.lock文件可能指向doctrine/mongodb仍然满足 ODM 版本要求的过时版本。在这种情况下,您需要升级您的依赖项(通过composer upgrade),这也应该升级您的锁定文件和其中的版本/提交点。

于 2013-04-09T21:58:09.563 回答