Download the PHP package soliantconsulting/entity-audit without Composer

On this page you can find all versions of the php package soliantconsulting/entity-audit. 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 entity-audit

SoliantEntityAudit

Build Status

An auditing module for Doctrine 2. Requires ZfcUser to map revisions to users. This module creates an entity to audit a specified target entity and tracks revisions to that target.

About

This module takes a configuration of entities to audit and creates entities to audit them and revision tracking entities. Included is a view layer to browse the audit records. Routing back to live application data is supported and view helpers allow you to find and browse to the latest audit record from a given audited entity.

Revisions pool all audited entities into revision buckets. Each bucket contains the revision entity for each audited record in a transaction.

Auditing is done in it's own transaction after a flush has been performed. Auditing takes two flushes in one transaction to complete.

Install

Require SoliantEntityAudit with composer

Enable SoliantEntityAudit in config/application.config.php:

Copy config/SoliantEntityAudit.global.php.dist to config/autoload/SoliantEntityAudit.global.php and edit setting as

Use the Doctrine command line tool to update the database and create the auditing tables:

Terminology

AuditEntity - A generated entity which maps to the Target auditable entity. This stores the values for the Target entity at the time a Revision is created.

Revision - An entity which stores the timestap, comment, an user for a single entity manager flush which contains auditable entities.

RevisionEntity - A mapping entity which maps an AuditEntity to a Revision and maps to a Target audited entity. This entity can rehydrate a Target entity and AuditEntity. This also stores the revision type when the Target was audited. INS, UPD, and DEL map to insert, update, and delete. The primary keys of the Target are stored as an array and can be used to rehydrate a Target.

Target entity - An auditable entity specified as string in the audit configuration.

Authentication

You may configure a custom entity to serve as the user entity for mapping revisions to users. You may configure a custom authentication service too. By default these map to ZfcUserDoctrineORM\Entity\User and zfcuser_auth_service. For example to use a custom entity and service Db\Entity\User for an entity and Zend\Authentication\AuthenticationService would work.

The user entity must implement getDisplayName, getId, and getEmail. The authentication service must implement hasIdentity and getIdentity which returns an instance of the current user entity.

Interfaces are not used so ZfcUser can be used out of the box.

Routing

To map a route to an audited entity include route information in the audit => entities config

Identifier column values from the audited entity will be added to defaults to generate urls through routing.

This is how to map from your application to it's current revision entity:

View Helpers

Return the audit service. This is a helper class. The class is also available via dependency injection factory This class provides the following:

  1. setComment(); Set the comment for the next audit transaction. When a comment is set it will be read at the time the audit Revision is created and added as the comment.

  2. getAuditEntityValues($auditEntity); Returns all the fields and their values for the given audit entity. Does not include many to many relations.

  3. getEntityIdentifierValues($entity); Return all the identifying keys and values for an entity.

  4. getRevisionEntities($entity) Returns all RevisionEntity entities for the given audited entity or RevisionEntity.

Return the latest revision entity for the given entity.

Return a paginator for all revisions of the specified class name.

Return a paginator for all RevisionEntity entities for the given entity or a paginator attached to every RevisionEntity for the given audited entity class.Pass an entity or a class name string.

Return a paginator for all Revision entities.

Returns the routing information for an entity by class name

Titling

If an entity has a __toString method it will be used to title an audit entity limited to 256 characters and stored in the RevisionEntity.

Inspired by SimpleThings


All versions of entity-audit with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
zendframework/zendframework Version >=2.1
doctrine/doctrine-module Version 0.8.*@dev
doctrine/doctrine-orm-module Version 0.8.x@dev
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 soliantconsulting/entity-audit contains the following files

Loading the files please wait ....