packagist damienharper/auditor-bundle 3.0.0

latest releases: dev-master, dev-dependabot/npm_and_yarn/postcss-8.4.48, dev-dependabot/composer/doctrine/data-fixtures-tw-2.0...
5 years ago

What's new

  • Annotation support: audit configuration (audited entities, ignored columns, etc) can be done mostly
    using annotations in entities.
  • Audit events: an audit event is dispatched for every audit entry opening the doors to add
    custom behavior on audit entry creation.
  • Security controls: audit access can be now restricted to specific roles.
  • The bundle now supports non numeric IDs for the User objects (thanks to @Gonzalo1987).
  • A transaction hash is now stored in audit tables and makes it easier to identify all operations performed
    in the same transaction.
    • The timeline now displays a transaction hash for each element. By clicking a transaction hash,
      you get a complete overview of all the operations included into the transaction.
    • AuditReader::getAudits() now accepts a transaction hash as fifth parameter to return audits
      logged in the given transaction for the given entity.
    • AuditReader::getAuditsByTransactionHash() accepts a transaction hash as parameter and returns
      all the audits logged in the given transaction.
  • Better single table (SINGLE_TABLE) inheritance support.
    • AuditReader::getAudits() now accepts a boolean as sixth parameter to return either audits
      for the given entity only or audits for the given entity hierarchy.
  • Add class table (JOINED) inheritance support (thanks to @versh23).
  • Performance enhancements when saving a lot of entities at once (thanks to @acanicatti).
  • Removed deprecation messages (thanks to @maxhelias).
  • Fixed an issue with audit:schema:update command when run against a database with no audit table.
  • A few icons have been added in the timeline.
  • Revamped documentation.

Breaking changes

  • The structure of audit tables has changed so you have to run the migration command right after updating
  • AuditEntry::getUserId() now return a string or null instead of an int.
  • When using a secondary database Doctrine's doctrine:schema:update command do not create
    audit tables automatically anymore (this command cannot work with multiple databases simultaneously),
    use the bundled migration command instead which supports the same options as Doctrine's command.
    • bin/console audit:schema:update --dump-sql prints SQL queries that need be executed.
    • bin/console audit:schema:update --force executes relevant SQL queries.
  • Configuration has changed to use a secondary database: you now only need to declare the dedicated
    entity manager in configuration file as described here.
  • The bundle requires mbstring extension (cf. https://www.php.net/manual/en/mbstring.installation.php).

How to upgrade?

Either update your composer.json file manually to include "damienharper/doctrine-audit-bundle": "^3.0"
or run

composer require damienharper/doctrine-audit-bundle ^3.0

Due to internal changes requiring new columns and blame_id column type change, run the migration command after updating the bundle to update the structure of your current audit tables.

bin/console audit:schema:update --force

Changes

New Contributors

References

Official documentation

Full Changelog: 2.5.0...3.0.0

Don't miss a new auditor-bundle release

NewReleases is sending notifications on new releases.