2017 © Pedro Peláez
 

cakephp-plugin cakephp-audit-log

image

hevertonfreitas/cakephp-audit-log

  • Monday, July 30, 2018
  • by hevertonfreitas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 108 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 72 Forks
  • 0 Open issues
  • 8 Versions
  • 27 % Grown

The README.md

Audit Log Plugin

Build Status Latest Stable Version Total Downloads Latest Unstable Version codecov License, (*1)

A logging plugin for CakePHP. The included AuditableBehavior creates an audit history for each instance of a model to which it's attached., (*2)

The behavior tracks changes on two levels. It takes a snapshot of the fully hydrated object after a change is complete and it also records each individual change in the case of an update action., (*3)

Features

  • Support for CakePHP 4.0
  • Tracks object snapshots as well as individual property changes.
  • Allows each revision record to be attached to a source -- usually a user -- of responsibility for the change.
  • Allows developers to ignore changes to specified properties. Properties named created, updated and modified are ignored by default, but these values can be overwritten.
  • Handles changes to HABTM associations.
  • Does not require or rely on the existence of explicit models revisions (AuditLog) and deltas (AuditLogDeltas).

Installation

You can install this plugin into your CakePHP application using composer., (*4)

The recommended way to install composer packages is:, (*5)

composer require hevertonfreitas/cakephp-audit-log

Load your plugin using, (*6)

bin/cake plugin load AuditLog

or by manually putting $this->addPlugin('AuditLog'); in the bootstrap method of your src/Application.php., (*7)

Then, run the necessary migrations, (*8)

bin/cake migrations migrate -p AuditLog

Next Steps

  1. Create a currentUser() method, if desired., (*9)

    The AuditableBehavior optionally allows each changeset to be "owned" by a "source" -- typically the user responsible for the change. Since user and authentication models vary widely, the behavior supports a callback method that should return the value to be stored as the source of the change, if any., (*10)

    The currentUser() method must be available to every model that cares to track a source of changes. It should return an array with a key id describing the primary key of the user that changed the record., (*11)

Usage

Applying the AuditableBehavior to a model is essentially the same as applying any other CakePHP behavior. The behavior does offer a few configuration options:, (*12)

`ignore`
An array of property names to be ignored when records are created in the deltas table.
`habtm`
An array of models that have a HABTM relationship with the acting model and whose changes should be monitored with the model. If the HABTM model is auditable in its own right, don't include it here. This option is for related models whose changes are _only_ tracked relative to the acting model.

License

This code is licensed under the MIT license., (*13)

Notes

Feel free to submit bug reports or suggest improvements in a ticket or fork this project and improve upon it yourself. Contributions welcome., (*14)

The Versions

30/07 2018

1.3.x-dev

1.3.9999999.9999999-dev

  Sources   Download

06/06 2018

dev-master

9999999-dev https://github.com/hevertonfreitas/cakephp-audit-log

A logging plugin for CakePHP. It takes a snapshot of the fully hydrated object after a change is complete and it also records each individual change in the case of an update action

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin log cakephp logging security audit

06/06 2018

2.2.0

2.2.0.0 https://github.com/hevertonfreitas/cakephp-audit-log

A logging plugin for CakePHP. It takes a snapshot of the fully hydrated object after a change is complete and it also records each individual change in the case of an update action

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin log cakephp logging security audit

06/06 2018

dev-dev

dev-dev https://github.com/hevertonfreitas/cakephp-audit-log

A logging plugin for CakePHP. It takes a snapshot of the fully hydrated object after a change is complete and it also records each individual change in the case of an update action

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin log cakephp logging security audit

01/04 2018

1.0.0

1.0.0.0

  Sources   Download

01/04 2018

1.0.1

1.0.1.0

  Sources   Download

21/08 2017

2.1.0

2.1.0.0 https://github.com/hevertonfreitas/cakephp-audit-log

A logging plugin for CakePHP. It takes a snapshot of the fully hydrated object after a change is complete and it also records each individual change in the case of an update action

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin log cakephp logging security audit

12/05 2016

2.x-dev

2.9999999.9999999.9999999-dev https://github.com/jippi/cakephp-audit-log

A logging plugin for CakePHP. It takes a snapshot of the fully hydrated object after a change is complete and it also records each individual change in the case of an update action

  Sources   Download

MIT

The Requires

 

plugin log cakephp logging security audit