Here’s a little script I’ve wanted to make for a while, but have only just finally got the motivation to work on.

It’s a lightweight Database wrapper with functions similar to Ruby on Rails’ ActiveRecord.

When I discovered the __call() method I wanted to make my own version in PHP, so here it is!

It supports most basic functions, all based on the MySQL set of PHP functions, no other wrapper is required (PEAR etc.). There is not (yet?) any automatic mysql_real_escape_string or anything, although that could easily be added if required, my assumption is you’ve done that kind of thing already before passing anything to it.

It’s only a first draft, so any comments, questions or pointing out any typo’s in the code, (yeah, there are likely to be a few…) would be muchly appreciated.

This work is free under the Creative Commons Share Alike 2.0 license.


DB_0.1.tar.gz (4.84Kb)

Edit: Think next on my list is TextMate syntax highlighting and maybe the non-default template…


Will I really ever use this?

Who knows… But maybe I’ll keep a log of all the cool stuff I find…