Developed with love by KnpLabs Hire us for your project!
208

DoctrineAuditBundle

by DamienHarper

Doctrine audits logs made easy.

DoctrineAuditBundle Tweet

Latest Stable Version
Latest Unstable Version
Build Status
License
Maintainability
Test Coverage
Scrutinizer Code Quality
Total Downloads
Monthly Downloads
Daily Downloads

This bundle creates audit logs for all Doctrine ORM database related changes:

  • inserts and updates including their diffs and relation field diffs.
  • many to many relation changes, association and dissociation actions.
  • if there is an user in token storage, it is used to identify the user who made the changes.
  • audit entries are inserted within the same transaction during flush event so that even if something fails the global state remains clean.

Basically you can track any change of any entity from audit logs.

NOTE: this bundle cannot track DQL or direct SQL update or delete statement executions.

You can try out this bundle by cloning its companion demo app.
Follow instructions at doctrine-audit-bundle-demo.

Official Documentation

The official documentation can be found here.

Version Information

Version Status PHP requirements Symfony requirements Badges

Changelog is available here

Usage

Once installed and configured, any database change
affecting audited entities will be logged to audit logs automatically.
Also, running schema update or similar will automatically setup audit logs for every
new auditable entity.

Contributing

DoctrineAuditBundle is an open source project. Contributions made by the community are welcome.
Send us your ideas, code reviews, pull requests and feature requests to help us improve this project.

Do not forget to provide unit tests when contributing to this project.
To do so, follow instructions in this dedicated README

Supported DB

  • MySQL
  • MariaDB
  • PostgreSQL
  • SQLite

This bundle should work with **any other* database supported by Doctrine.
Though, we can only really support the ones we can test with Travis CI.*

Credits

License

DoctrineAuditBundle is free to use and is licensed under the MIT license

MIT License

Copyright 2018 Damien Harper

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
  • Audit operations were stored in reverse order in transaction
    By DamienHarper, 3 months ago
  • Add operation type constants
    By DamienHarper, 3 months ago
  • check if is initialized before call initializeObject (#193)
    By web-flow, 3 months ago
  • Code cleanup
    By DamienHarper, 3 months ago
  • Headers adjustments
    By DamienHarper, 4 months ago
  • Added build badges for supported branches
    By DamienHarper, 4 months ago
  • Refactoring (#188)
    By web-flow, 4 months ago
  • Don't specify the doctrine connection in services.yml (#185)
    By web-flow, 4 months ago
  • Fixed audit annotation loader
    By DamienHarper, 4 months ago
  • Fixed broken path to helper
    By DamienHarper, 4 months ago
  • Fixed broken annotated route loader
    By DamienHarper, 4 months ago
  • Include 3.x branch on Travis
    By DamienHarper, 4 months ago
  • Simplified class names (#182)
    By web-flow, 4 months ago
  • AuditHelper Refactoring (#181)
    By web-flow, 4 months ago
  • Update requirements (#180)
    By web-flow, 4 months ago
  • 3.4.0 release
    By DamienHarper, 4 months ago
  • Add missing discriminator property and getter to AuditEntry
    By DamienHarper, 4 months ago
  • Fix PHPStan rules
    By DamienHarper, 4 months ago
  • Leverage `DoctrineHelper::getRealClassName()` to avoid proxy references in audit entries (#179)
    By web-flow, 4 months ago
  • Removal of a doc leftover since PagerFanta removal (#173)
    By DamienHarper, 5 months ago
  • Changed how the entity FQDN is obtained (#175)
    By web-flow, 5 months ago
  • Fix #169
    By DamienHarper, 5 months ago
  • Add audited entity FQCN to event payload (#174)
    By web-flow, 5 months ago
  • Adding date range function getAuditsByDate (#172)
    By web-flow, 5 months ago
  • Cleanup command accepts an ISO 8601 date interval (#170)
    By web-flow, 6 months ago
  • Fixed PHP 7.1 BC break
    By DamienHarper, 6 months ago
  • Updated CHANGELOG.md
    By DamienHarper, 6 months ago
  • Fixed a BC break with symfony 4.3+
    By DamienHarper, 6 months ago
  • Updated CHANGELOG.md
    By DamienHarper, 6 months ago
  • Ordered `require` and `require-dev` sections of composer.json
    By DamienHarper, 6 months ago