CakePHP Versioning/History Behavior
Strangely enough, every time Core CakePHP Developer Nate Abele and I were standing near a train, we somehow got talking about creating a versioning behavior for CakePHP. Today, I was taking a train back from Boston to Connecticut where I live, so I decided to draft up an implementation while I was taking the two hour scenic train ride; it’s only fitting!
Sometimes it’s useful to keep history of a database table. Once you track the history of a table, it is trivial to do diffs on the records, or even revert to a previous revision. Implementing this is usually a manual process for each table unless you’re clever enough to create your own magic system. But luckily, with the extensible magic of CakePHP, I was able to draft up a behavior that can easily be added to any table in my database. Voila! Automatic versioning, diffing, and undo for any table in my schema. I’m still finishing up the unit tests and adding some features, but I will post my work soon. Are you interested?