Class' Doctrine \ Common \ Cache \ ArrayCache'未找到

时间:2015-02-10 15:44:39

标签: php symfony doctrine-orm

我从备份中复制symfony2应用程序。我删除缓存并尝试使用composer install或composer update - get error

PHP Fatal error:  Class 'Doctrine\Common\Cache\ArrayCache' not found in /home/div/app/cache/dev/appDevDebugProjectContainer.php on line 1033
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception

[RuntimeException]                                                         
  An error occurred when executing the "'cache:clear --no-warmup'" command.

这是我的composer.json

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" ,  "mea":"vendor/Mea/CoreBundle/"}
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.5.*",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "~1.2",
        "twig/extensions": "~1.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~2.3",
        "sensio/framework-extra-bundle": "~3.0",
        "sensio/generator-bundle": "~2.3",

        "jbafford/password-strength-bundle": "dev-master",

        "friendsofsymfony/user-bundle": "2.0.*@dev",

        "weotch/phpthumb": "dev-master",
        "meenie/javascript-packer": "dev-master",
        "natxet/CssMin": "dev-master",
        "apy/datagrid-bundle": "dev-master",

        "zetacomponents/mail": "dev-master",

        "egeloen/ckeditor-bundle": "2.2.*@dev",

        "instaclick/translation-editor-bundle": "dev-master",

        "endroid/qrcode": "1.*@dev",

        "whiteoctober/tcpdf-bundle": "dev-master",

        "ddeboer/data-import": "dev-master",

        "payum/payum-bundle": "*@stable",
        "payum/paypal-express-checkout-nvp": "*@stable",

        "simplethings/entity-audit-bundle": "0.*@dev",

        "twilio/sdk": "dev-master",

        "vich/uploader-bundle": "1.0.*@dev",

        "astina/social-links-bundle":"dev-master",

        "Mea/CoreBundle": "dev-master",
        "Mea/InvoiceBundle": "dev-master",
        "Mea/PostBoxBundle": "dev-master",
        "Mea/Emailer": "dev-master",

        "incenteev/composer-parameter-handler": "~2.0"
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "git@bitbucket.org:grekpg/meacorebundle.git"
        },{
            "type": "vcs",
            "url":  "git@bitbucket.org:grekpg/meainvoicebundle.git"
        },{
            "type": "vcs",
            "url":  "git@bitbucket.org:grekpg/emailer.git"
        },{
            "type": "vcs",
            "url":  "git@bitbucket.org:grekpg/postboxbundle.git"
        }
    ],
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "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": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "symfony-assets-install": "symlink",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.4-dev"
        }
    }
}

任何想法如何修复此应用程序?

3 个答案:

答案 0 :(得分:8)

我们在恢复其中一个备份时遇到了同样的错误。

在我们的自动备份中,有一条规则不包含symfony cache目录。该规则过于宽松,源文件夹vendor/doctrine/cache也被排除在外。

检查供应商目录是否有源文件,如果没有,则将其恢复。

这解决了我们的问题。

答案 1 :(得分:0)

可能会手动尝试删除缓存文件夹

或尝试

php app/console cache:clear --env=prod --no-debug
php app/console cache:clear --env=dev --no-debug

答案 2 :(得分:0)

检查vendor / doctrine / cache目录。

它不应该是空的