xiidea / EasyAuditBundle

A Symfony Bundle To Log Selective Events
http://xiidea.github.io/EasyAuditBundle/
MIT License
89 stars 22 forks source link

Update Logger.php #49

Closed xkzl closed 3 years ago

xkzl commented 3 years ago

Hi Xiidea,

Please consider upgrading for Symfony 5.2 the file ./vendor/xiidea/easy-audit/Logger/Logger.php

use Doctrine\Common\Persistence\ManagerRegistry;

to be replaced by

use Doctrine\Persistence\ManagerRegistry;

https://symfony.com/doc/current/doctrine.html#querying-for-objects-the-repository

ronisaha commented 3 years ago

For now use following code in a common file,

if(!class_exists('Doctrine\Common\Persistence\ManagerRegistry')) {
    class_alias('Doctrine\Persistence\ManagerRegistry', 'Doctrine\Common\Persistence\ManagerRegistry');
}

You may also need some more class alias like:

if(!class_exists('Doctrine\Common\Persistence\Event\LifecycleEventArgs')) {
    class_alias('Doctrine\Persistence\Event\LifecycleEventArgs', 'Doctrine\Common\Persistence\Event\LifecycleEventArgs');
}

if(!class_exists('Doctrine\Common\Persistence\Mapping\ClassMetadata')) {
    class_alias('Doctrine\Persistence\Mapping\ClassMetadata', 'Doctrine\Common\Persistence\Mapping\ClassMetadata');
}
xkzl commented 3 years ago

Just a suggestion for your sake. ;) I don't really need support for that

ronisaha commented 3 years ago

@xKZL Thanks for your suggestion and help. We need to support SF5.2 as well as php8. I'm working on that. So both the update will be land on next release with backward compatibility promise.