Download the PHP package imsamurai/audit-log without Composer

On this page you can find all versions of the php package imsamurai/audit-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package audit-log

API Documentation

Check out Audit log API Documentation

Abstract

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License

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

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.

Features

Installation

CakePHP >= 2.0

As an Archive

  1. Download and extract the source to app/Plugin/AuditLog.

As a Submodule

  1. $ git submodule add git://github.com/imsamurai/CakePHP-Audit-Log-Plugin.git <path_to>/app/Plugin/AuditLog
  2. $ git submodule init
  3. $ git submodule update

Via composer

  1. add into your composer "require": { "imsamurai/audit-log": "1.1.*", }
  2. composer update

To create tables you can use schema shell. To create tables execute:

cd <path_to>/app/
chmod +x ./Console/cake
./Console/cake schema create -p AuditLog

CakePHP 1.3.x

For use with CakePHP 1.3.x, be sure to use code from the 1.3 branch and follow the instructions in that README file (NOT MAINTAINED).

Next Steps

  1. Run the install.sql file on your CakePHP application database or use schema. This will create the audits and audit_deltas tables that will store each object's relevant change history.
  2. Add plugin into bootstrap.php

  3. Create a currentUser() method, if desired.

    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.

    The currentUser() method must be available to every model that cares to track a source of changes, so I recommend that a copy of CakePHP's app_model.php file be created and the method added there. Keep it DRY, right?

    The behavior expects the currentUser() method to return an associative array with an id key. Continuing from the example above, the following code might appear in the AppModel:

  4. Attach the behavior to any desired model and configure.

Usage

AuditableBehavior

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

`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.

AuditHelper

AuditController

For filter by date you can use all formats (single or range) that constructor of DateTime can understand. For example:

Hint: you can use bootstrap daterange picker for this field.

Syntax

Limitations

License

This code is licensed under the MIT license.

Notes

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

Changelog

1.1.1

1.1.0


All versions of audit-log with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
composer/installers Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package imsamurai/audit-log contains the following files

Loading the files please wait ....