【问题标题】:Mongo 2.4.1 upgrade causing Fatal error: Class 'Doctrine\MongoDB\Util\InvalidArgumentException' not foundMongo 2.4.1 升级导致致命错误:找不到类 'Doctrine\MongoDB\Util\InvalidArgumentException'
【发布时间】:2013-04-09 13:08:01
【问题描述】:

我一切正常,我升级了我的 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 但这一次不起作用。

有人可以帮帮我吗?

【问题讨论】:

    标签: mongodb symfony boost mongodb-php


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2012-05-09
      • 2014-08-11
      • 2017-07-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-14
      • 2012-04-01
      相关资源
      最近更新 更多