-
Notifications
You must be signed in to change notification settings - Fork 14
0.1 Documentation
An module to audit Doctrine 2 entities in ZF2 and browse the audit log. Inspired by https://github.com/simplethings/EntityAudit
- download ZF2EntityAudit from composer
php composer.phar require "tawfekov/zf2entityaudit": "dev-master"
or by adding it to composer.json
then using php composer.phar update
to install it
- Add the ZF2EntityAudit module to your application config
config/application.config.php
:
return array(
'modules' => array(
'ZF2EntityAudit'
...
),
- copy
config/zf2entityaudit.global.php.dist
toconfig/autoload/zf2entityaudit.global.php
and edit setting as
<?php
return array(
'audit' => array(
'datetime.format' => 'r',
'tableNamePrefix' => '',
'tableNameSuffix' => '_audit',
'revisionTableName' => 'Revision',
'revisionEntityTableName' => 'RevisionEntity',
'entities' => array(
'Application\\Entity\\Type',
),
),
);
ZFCUser integration will assign the logged-in user to the revision log. If an audited record changes when a user is not logged in or set on the ModuleOptions object Anonymous will be used.
- use doctrine command line tool to update the database and created the auditing tables :
vendor/bin/doctrine-module orm:schema-tool:update
-
viewing the auditing records : Routes are added from /audit This module provides the view layer for browsing the audit log from this route. In production server you can protect this interface with ACL. I'd suggest using BjyAuthorize.
-
if you find any problems or have ideas to improve this module please let us know
on Github : tawfekov on Twitter: @tawfekov
##Thanks Thanks also flys to TomHAnderson for his Contributions.