Symfony 3.3 of 3.2: Compilation error: unable to declare class Symfony \ Bundle \ SecurityBundle \ Security \ FirewallMap

I'm having some problems since I upgraded from symfony 3.2 to 3.3, I got this error

Compile Error: Cannot declare class Symfony\Bundle\SecurityBundle\Security\FirewallMap, because the name is already in use
in classes.php (line 1709)
in ClassCollectionLoader.php (line 99)
at ClassCollectionLoader::load()in Kernel.php (line 428)
at Kernel->doLoadClassCache()in Kernel.php (line 112)
at Kernel->boot()in Kernel.php (line 168)
at Kernel->handle()in app_dev.php (line 12)
at {main}()in app_dev.php (line 0)

This is interesting because I only got this error through app_dev.php through the browser, if I directly exeucte

php app_dev.php

Then the error does not appear, and I just redirect to the login page, as I believe that

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="1;url=http://:/login" />

        <title>Redirecting to http://:/login</title>
    </head>
    <body>
        Redirecting to <a href="http://:/login">http://:/login</a>.
    </body>
</html>

The commands work fine, I can clear the cache, debug routes ...

Any ideas?

Thank!

Update: here is the contents of app_dev.php

<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;

/** @var \Composer\Autoload\ClassLoader $loader */
$loader = require __DIR__.'/../app/autoload.php';
Debug::enable();

$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
+3
source share
4 answers

I decided to delete the vendor / symfony folder and update the linker

+1
source

Celso, , , var/cache

+1

, .

:

  • MyClass.php, MyClass
  • - : MyClass_2.php

" AppBundle\Entity\MyClass, " - , .

- , -.:)

, , - 2 , , - Symfony - .

0

, , , , , , - . Twig - :

{{ constant('App\\Entity\\\\MyClass::MY_CONSTANT') }}

:

{{ constant('App\\Entity\\MyClass::MY_CONSTANT') }}

.

0

Source: https://habr.com/ru/post/1678865/


All Articles