THIS PROJECT IS NO LONGER MAINTAINED AS I HAVE SWITCHED TO RUBY ON RAILS.
OH, AND PLEASE STOP SENDING ME PHP JOB OFFERS, I'M NOT INTERESTED IN COMING BACK.
This is almost-direct port of Fuel's DBUtil class. It's not tested, it may not work, crash or throw random obscenities. If you are willing to test it thoroughly - go ahead, be my guest, I'd be happy to add you to contributors list.