注释不存在,或者无法在Symfony中自动加载

时间:2017-08-11 09:50:20

标签: php symfony

当我将Smfony从2.7版本升级到3.2时,我遇到了一个我不一定理解的问题。我已升级composer.json中的所有依赖项。为此,请遵循symfony更新。所有依赖项安装都很好,但是当我到达脚本部分(即清空缓存并安装资产)时,我收到此错误

Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
PHP Fatal error:  Uncaught exception 'Doctrine\Common\Annotations\AnnotationException' with message '[Semantical Error] The annotation "@Hello\ReleasesBundle\Entity\Package" in class Ubiflow\ReleasesBundle\Controller\PackageController does not exist, or could not be auto-loaded.' in /home/web/gestionnaire/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54

我已经通过添加来自供应商的autoload.php文件更改了这些文件,删除了bootstrap.cache就像在一些Symfony升级教程中所说的那样(app / console,app / AppCache,app / phpunit.xml.dist,网络/ app.php,网络/ app_dev.php)

这是composer.json

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-4": { "": "src/" },
        "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
    },
    "require": {
        "php": ">=5.5.9",
        "symfony/symfony": "3.2.*",
        "symfony/assetic-bundle": "2.7.*",
        "symfony/swiftmailer-bundle": "^2.3.10",
        "symfony/monolog-bundle": "^3.0.2",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.2",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-migrations-bundle": "1.1.*",
        "twig/extensions": "1.3.*",
        "twig/twig": "^1.0||^2.0",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "sensio/generator-bundle": "3.0.*",
        "jms/security-extra-bundle": "1.6.*",
        "jms/serializer-bundle": "1.1.*",
        "knplabs/knp-menu-bundle": "2.1.*",
        "knplabs/knp-paginator-bundle": "2.5.*",
        "friendsofsymfony/jsrouting-bundle": "2.0.*",
        "friendsofsymfony/rest-bundle": "1.7.*",
        "brazilianfriendsofsymfony/twig-extensions-bundle": "dev-master",
        "kbsali/redmine-api": "1.5.*",
        "circle/doctrine-rest-driver": "1.2.2"
    },
    "scripts": {
        "symfony-scripts": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-install-cmd": [
            "@symfony-scripts"
        ],
        "post-update-cmd": [
            "@symfony-scripts"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "sort-packages": true,
    "minimum-stability": "alpha",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "branch-alias": {
            "dev-master": "3.2-dev"
        }
    }
}

0 个答案:

没有答案