8000 [3.4] Cannot redeclare class Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser · Issue #25334 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[3.4] Cannot redeclare class Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser #25334
Closed
@gnutix

Description

@gnutix
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4.*
PHP version 5.6.25

Stacktrace

We're currently upgrading a Symfony project to 3.4 on PHP 5.6.25 and my colleague has been having this issue since I've added the following block of code to our AppKernel::registerContainerConfiguration method:

        $loader->load(function (ContainerBuilder $container) {
            $container->setParameter('container.autowiring.strict_mode', true);
            $container->setParameter('container.dumper.inline_class_loader', true);
            $container->addObjectResource($this);
        });

It only happened on a second request, and often it had to be a different request, not just the same one (aka refresh didn’t cause it).

He found two ways to make it work :

  1. Commenting out the line $container->setParameter('container.dumper.inline_class_loader', true);, or
  2. Commenting out the line $kernel->loadClassCache(); in app_dev.php

I personally can't reproduce the issue on my setup. Any idea what might be happening here ?

Also, it might look like we're not the only ones : https://stackoverflow.com/questions/47617879/symfony-duplicate-class-definition-in-cache

Thanks for your help.
gnutix

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0