lourdas / record-tracker

A PHP library to track changes made in database records or models

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Record Tracker

Introduction

This is a PHP library with the purpose of storing record changes in a database. What does that mean?

Let's say you work with a database model (as in the MVC pattern, of course this is not required) and you create it, update it again and again, and finally delete it at the end of its lifecycle. Wouldn't it be nice to track its attribute changes over its lifecycle? Well, that's what Record Tracker does.

It's a simple library that connects to the database (currently only PostgreSQL and MySQL/MariaDB are supported) and stores the model attribute changes with a few metadata about this:

  • Type of record change, (C)reate, (U)pdate or (D)elete
  • Timestamp of change
  • User that created the change
  • The table name of the changed record
  • And the primary key of the changed record

The attribute changes are stored like this:

  • Column name
  • Old value
  • New value

See Usage for details about how to use the library and Changes for the changelog.

The library is distributed under Mozilla Public License 2.0 (MPL-2).

News

2018-07-15: Complete MySQL/MariaDB support.

2018-07-11: Initial release.

About

A PHP library to track changes made in database records or models

License:Mozilla Public License 2.0


Languages

Language:PHP 100.0%