0
votes

I am currently trying to update a Symfony 3.3 to the latest Symfony 3.4 (will port it to Symfony 4 before support runs out, no time to rewrite the system though) and PHP 7. Since PHP 7.3 seems to not work that great with 3.4 I decided to stay on PHP 7.2 for now.

I updated the composer.json, ran composer install (and update with dependencies) and clearned the cache. However, after everything worked flawlessly within composer, I tried to access the system where I am greeted by the following message:

Fatal error: Uncaught Error: Undefined class constant 'IGNORE_ON_UNINITIALIZED_REFERENCE' in E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass.php:93 Stack trace: #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 in E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass.php on line 93

Any thought how I could fix that? I am sure I have a wrong package installed or something. Here's the composer.json for reference:

{
    "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

1 Answers

0
votes

I was able to fix this issue with the help of the Symfony Devs Slack group. It turned out that the constant was indeed set, however due to some faulty cache it wasn't included in the runtime.

To fix this issue, I had to manually remove the cache/prod and cache/dev folders instead of using the bin/console cache:clear command.