Bonjour,
Suite à l'acquisition d'un nouvel ordinateur je réinstalle tout !
Je recupère un projet sur gitlab avec un git clone qui est un projet symfony 4.
Quand j'éxécute composer install j'ai cette erreur qui apparait et pas moyen de trouver de solutions :(
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!!
!! Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "DoctrineCacheBundle" from namespace "Doctrine\Bundle\DoctrineCacheBundle".
!! Did you forget a "use" statement for another namespace? in /Users/manuelalvarez-iglisias/Sites/moto-bleue/src/Kernel.php:33
!! Stack trace:
!! #0 /Users/manuelalvarez-iglisias/Sites/moto-bleue/vendor/symfony/http-kernel/Kernel.php(429): App\Kernel->registerBundles()
!! #1 /Users/manuelalvarez-iglisias/Sites/moto-bleue/vendor/symfony/http-kernel/Kernel.php(130): Symfony\Component\HttpKernel\Kernel->initializeBundles()
!! #2 /Users/manuelalvarez-iglisias/Sites/moto-bleue/vendor/symfony/framework-bundle/Console/Application.php(159): Symfony\Component\HttpKernel\Kernel->boot()
!! #3 /Users/manuelalvarez-iglisias/Sites/moto-bleue/vendor/symfony/framework-bundle/Console/Application.php(65): Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands()
!! #4 /Users/manuelalvarez-iglisias/Sites/moto-bleue/vendor/symfony/console/Application.php(149): Symfony\Bund in /Users/manuelalvarez-iglisias/Sites/moto-bleue/src/Kernel.php on line 33
!!
Script @auto-scripts was called via post-install-cmd
Quelqu'un à déjà eu ce problème ?
Merci à Laurent Rossillol sur stack pour sa solution :
This seems to be due to the upgrade of doctrine-bundle => v2.0.0.
You have to change :
Symfony\Bridge\Doctrine\RegistryInterface => Doctrine\Common\Persistence\ManagerRegistry
Doctrine\Common\Persistence\ObjectManager => Doctrine\ORM\EntityManagerInterface
In your "App\Repository\AbsenceRepository" please update your constructor:
public function construct(\Doctrine\Common\Persistence\ManagerRegistry $registry)
{
parent::construct($registry, Address::class);
}