从3.3更新到3.4时,未定义的类常量'IGNORE_ON_UNINITIALIZED_REFERENCE'

时间:2019-03-05 09:12:07

标签: php symfony symfony-3.4 symfony-3.3

我目前正在尝试将Symfony 3.3更新到最新的Symfony 3.4(将在支持用尽之前将其移植到Symfony 4,尽管没有时间重写系统)和PHP7。因为PHP 7.3似乎无法正常工作在3.4版本中,我决定暂时使用PHP 7.2。

我更新了composer.json,运行了composer安装(并使用依赖项进行更新)并清除了缓存。但是,在作曲家中一切正常工作之后,我尝试通过以下消息访问系统:

  

致命错误:未捕获错误:未定义类常量   的“ IGNORE_ON_UNINITIALIZED_REFERENCE”   E:\ XAMPP7_2 \ htdocs \ wsm-rando \ vendor \ symfony \ symfony \ src \ Symfony \ Bundle \ FrameworkBundle \ DependencyInjection \ Compiler \ CachePoolPass.php:93   堆栈跟踪:#0   E:\ XAMPP7_2 \ htdocs \ wsm-rando \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ DependencyInjection \ Compiler \ Compiler.php(141):   Symfony \ Bundle \ FrameworkBundle \ DependencyInjection \ Compiler \ CachePoolPass-> process(Object(Symfony \ Component \ DependencyInjection \ ContainerBuilder))   #1 E:\ XAMPP7_2 \ htdocs \ wsm-rando \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ DependencyInjection \ ContainerBuilder.php(788):   Symfony \ Component \ DependencyInjection \ Compiler \ Compiler-> compile(Object(Symfony \ Component \ DependencyInjection \ ContainerBuilder))   #2 E:\ XAMPP7_2 \ htdocs \ wsm-rando \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ HttpKernel \ Kernel.php(637):   Symfony \ Component \ DependencyInjection \ ContainerBuilder-> compile()#3   E:\ XAMPP7_2 \ htdocs \ wsm-rando \ vendor \ symfony \ symfony \ src \ Symfony \ Component \ HttpKernel \ Kernel.php   在   E:\ XAMPP7_2 \ htdocs \ wsm-rando \ vendor \ symfony \ symfony \ src \ Symfony \ Bundle \ FrameworkBundle \ DependencyInjection \ Compiler \ CachePoolPass.php   在第93行

有人想过我该如何解决?我确定安装了错误的软件包或其他东西。 这是composer.json供参考:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/", "SymfonyStandard": "app/" }
    },
    "require": {
        "php": ">=5.5.9",
        "symfony/symfony": "3.4.*",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.2",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "^3.1",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "^2.0",
        "twig/extensions": "~1.0",
        "symfony/assetic-bundle": "~2.3",
    "faceleg/html5lib-php": "dev-master",
        "smalot/pdfparser": "*",
        "seostats/seostats": "dev-master",
        "nategood/httpful": "*",
        "twbs/bootstrap": "*",
        "friendsofsymfony/user-bundle": "2.0.*",
        "phpoffice/phpspreadsheet": "^1.1",
      "ext-json": "*"
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0"
    },
    "scripts": {
        "post-root-package-install": [
            "SymfonyStandard\\Composer::hookRootPackageInstall"
        ],
        "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",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
        ],
        "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",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "symfony-var-dir": "var",
        "symfony-bin-dir": "bin",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.5-dev"
        }
    }
}

1 个答案:

答案 0 :(得分:0)

我能够在Symfony Devs Slack组的帮助下解决此问题。原来,确实设置了该常量,但是由于某些错误的缓存,该常量未包含在运行时中。

要解决此问题,我必须手动删除cache/prodcache/dev文件夹,而不要使用bin/console cache:clear命令。