How to upgrade to a newer version
Jump to the Upgrading from a previous version section
if you're not upgrading from DoctrineAuditBundle
DoctrineAuditBundleDoctrineAuditBundle is now deprecated since it has been split into two separate packages
auditor the core libraryauditor-bundle a Symfony bundle providing auditor integration into Symfony applicationsSo, upgrading from DoctrineAuditBundle to auditor + auditor-bundle requires a few steps
Create a new configuration file dh_auditor.yaml
(full configuration reference available here)
Minimal config file:
dh_auditor:
enabled: true
providers:
doctrine:
table_prefix: ~
table_suffix: '_audit'
auditor-bundle as a dependencyRun the following command in a console
composer require damienharper/auditor-bundle ^4.0
Replace the use statement related to Audit annotation to reference the new namespace in your entities.
- use DH\DoctrineAuditBundle\Annotation as Audit;
+ use DH\Auditor\Provider\Doctrine\Auditing\Annotation as Audit;
Reference the new routes in the config/routes.yaml
- dh_doctrine_audit:
- resource: "@DHDoctrineAuditBundle/Controller/"
- type: annotation
+ dh_auditor:
+ resource: "@DHAuditorBundle/Controller/"
+ type: annotation
Route names have been renamed, change them accordingly in your code. You'll find below a summary of route name changes.
Before (DoctrineAuditBundle route name) |
After (auditor-bundle route name) |
|---|---|
dh_doctrine_audit_list_audits |
dh_auditor_list_audits |
dh_doctrine_audit_show_transaction |
dh_auditor_show_transaction |
dh_doctrine_audit_show_entity_history |
dh_auditor_show_entity_history |
AuditReader deprecationAuditReader has been replaced by Reader and Query objects, so if you used it to query
the audit logs, dive into the Querying audits section
DoctrineAuditBundleRun the following command in a console
composer remove damienharper/doctrine-audit-bundle
Check the Upgrading from a previous version below to ensure your schema is up to date.
Once you upgraded the bundle to a newer version, you first have to be sure your current schema is up to date and upgrade it if necessary.
The following command does all of this for you:
# symfony < 3.4
app/console audit:schema:update --force
# symfony >= 3.4
bin/console audit:schema:update --force