Sunday, August 06, 2006

PHP Code Generator


I am currently redoing a site for a client that is written in PHP. So instead of hand writing all the classes that interface with the MySql database I wrote a quick code generator. Hopefully, this will help some other bloke. It doesn't cover everything but it gives a decent base to finish up the class. Things like data validation have not been implemented because I am trying to follow the KISS principle. The reason I wrote this instead of using some of the open source ones out there is for two reasons.

1) The simple ones required you to hand type the fields..LAME!
2) Other ones wanted you to use their framework. Which didn't work for me as I just wanted a class I could use with the existing code base.

The file with an example can be download at: http://www.mde-dev.com/downloads/phpCodeGenerator.zip