This document summarizes the backward incompatible changes introduced in auditor-bundle 7.0.
For a complete upgrade guide with step-by-step instructions, see the full documentation.
| Requirement | 6.x | 7.0 |
|---|---|---|
| PHP | >= 8.2 | >= 8.4 |
| Symfony | >= 5.4 | >= 8.0 |
| Doctrine DBAL | >= 3.2 | >= 4.0 |
| Doctrine ORM | >= 2.13 | >= 3.2 |
| Doctrine Bundle | >= 2.0 | >= 3.0 |
| PHPUnit | >= 11.0 | >= 12.0 |
| damienharper/auditor | >= 3.2 | >= 4.0 |
See auditor UPGRADE-4.0.md for auditor library changes.
This bundle requires damienharper/auditor >= 4.0 which introduces several breaking changes:
| Before (3.x) | After (4.0) |
|---|---|
DH\Auditor\...\Auditing\Annotation\Auditable |
DH\Auditor\...\Auditing\Attribute\Auditable |
DH\Auditor\...\Auditing\Annotation\Ignore |
DH\Auditor\...\Auditing\Attribute\Ignore |
DH\Auditor\...\Auditing\Annotation\Security |
DH\Auditor\...\Auditing\Attribute\Security |
DH\Auditor\...\Auditing\Annotation\AnnotationLoader |
DH\Auditor\...\Auditing\Attribute\AttributeLoader |
The implicit mb_convert_encoding() pass on every audit entry is disabled by default (DBAL 4 enforces UTF-8). Re-enable it explicitly if needed:
dh_auditor:
providers:
doctrine:
utf8_convert: true| Before | After |
|---|---|
$entry->getId() |
$entry->id |
$entry->getType() |
$entry->type |
$entry->getObjectId() |
$entry->objectId |
$entry->getUserId() |
$entry->userId |
$entry->getUsername() |
$entry->username |
$entry->getCreatedAt() |
$entry->createdAt |
See auditor UPGRADE-4.0.md for the complete list of changes.
| Before (6.x) | After (7.0) |
|---|---|
dh_auditor_show_entity_history |
dh_auditor_show_entity_stream |
dh_auditor_show_transaction |
dh_auditor_show_transaction_stream |
CLI commands now use the command name as the user identifier:
| Before (6.x) | After (7.0) |
|---|---|
blame_id: "command" |
blame_id: "app:import-users" |
blame_user: "app:import-users" |
blame_user: "app:import-users" |
Note: Existing audit entries with blame_id = "command" will not be automatically migrated.
| Removed Class | Replacement |
|---|---|
DH\AuditorBundle\DependencyInjection\Configuration |
DHAuditorBundle::configure() |
DH\AuditorBundle\DependencyInjection\DHAuditorExtension |
DHAuditorBundle::loadExtension() |
DH\AuditorBundle\DependencyInjection\Compiler\AddProviderCompilerPass |
Autowiring |
DH\AuditorBundle\DependencyInjection\Compiler\CustomConfigurationCompilerPass |
DHAuditorBundle::loadExtension() |
DH\AuditorBundle\DependencyInjection\Compiler\DoctrineProviderConfigurationCompilerPass |
DoctrineMiddlewareCompilerPass |
The AnonymousToken handling was removed (deprecated in Symfony 6.0, removed in Symfony 8.0).
The following Twig blocks have been removed from the base layout:
| Removed Block | Reason |
|---|---|
navbar |
Replaced by built-in header |
breadcrumbs |
No longer used |
The dh_auditor_header and dh_auditor_pager blocks are still available in stream templates.
If you override layout.html.twig, update your template to use the available blocks: title, stylesheets, dh_auditor_content, javascripts.
The setup5, setup6, setup7, setup8 scripts have been replaced by a unified setup script.
The following classes now use PHP 8.4+ attributes for auto-configuration:
| Class | Attributes Used |
|---|---|
ConsoleEventSubscriber |
#[AsEventListener] |
ViewerEventSubscriber |
#[AsEventListener] |
ViewerController |
#[AsController] |
TimeAgoExtension |
#[AsTwigFilter] |
RoutingLoader |
#[AutoconfigureTag] |
The following classes are now final and cannot be extended:
DH\AuditorBundle\Event\ConsoleEventSubscriberDH\AuditorBundle\Event\ViewerEventSubscriberDH\AuditorBundle\Twig\TimeAgoExtensionDH\AuditorBundle\Routing\RoutingLoaderDH\AuditorBundle\User\UserProviderDH\AuditorBundle\User\ConsoleUserProviderDH\AuditorBundle\Security\SecurityProviderDH\AuditorBundle\Security\RoleCheckerDH\AuditorBundle\Viewer\ActivityGraphProvider
| Before | After |
|---|---|
$provider->getDays() |
$provider->days |
$provider->getLayout() |
$provider->layout |
TimeAgoExtension no longer extends Twig\Extension\AbstractExtension. If you extended this class, update your code accordingly.
SecurityProvider now uses #[Autowire] attribute for dependency injection. This is an internal change but may affect you if you were manually constructing this service.
# 1. Update dependencies
composer require php:^8.4 symfony/framework-bundle:^8.0 \
doctrine/dbal:^4.0 doctrine/orm:^3.2 doctrine/doctrine-bundle:^3.0 \
damienharper/auditor:^4.0 damienharper/auditor-bundle:^7.0
# 2. Clear cache
bin/console cache:clear
# 3. Check schema
bin/console audit:schema:update --dump-sql