INSTRAW Tech, Take 1: CakePHP

UN INSTRAW researchers have become fond of building databases of their research, for public consumption .. very simple, small, searchable lists of research institutions and documentation and the like. The permanent web dev here, being a very nice and agreeable guy, has allowed the data for these databases to be compiled in Microsoft Word .. which he has dutifully, if not a bit pervertedly ;), processed into SQL INSERTS using a combination of AbiWord, yacc (!!), and Perl.

One of my tasks in taking on part time work here (in exchange for salary, and office space for my own work, in the other-part time .. well you can imagine how that turned out..) was to build one of these databases, for Gender Research Methodology references. Clearly there must be a better way! Even with the perverse call of yacc in my possible web development toolbox.

With only a single table, the most braindead CRUD scaffolding was going to get me 99% of the way there. The Word Documents would be banished (except for one final import for this database .. which became so painful, battling AbiWord’s crummy character encoding translation, that I abondoned the automated import for YES a manual import)! I started looking at Rails obviously, but thought again, this place being by and large a PHP shop, I shouldn’t foist too much new stuff on the place.

Looking around for PHP Frameworks, there were quite a few, like Zend and Symfony .. but CakePHP kept jumping out at me. Maybe I was hungry, or maybe it was the way the logo danced on the CakePHP site. Being called the Rails of PHP was somewhat hopeful, and going through the 15 minute Blog Tutorial sealed the deal. The architecture and conventions were dead on similar to Rails. Sure it didn’t have all the features of Rails, but in a way it felt a little simpler to get around (and maybe not so many panicky bug fixes). PHP still feels comfortable to me.

The resulting application is dead simple — CRUD administration, with a Searchable front end, on a single table. I basically only added a Helper for what I termed a Psuedo-Set — a group of Boolean SQL columns that share the same prefix. I wanted an easy way to display these as a group, and wrote a helper to do so based transparently on model inspection. (If this is of any use to anyone, let me know and I’ll publish it). Also, CakePHP’s builtin TextHelper had slightly buggy autoLinkUrls method, so I wrote my own version.

The next time they need a database app here, it should be possible to be up and running within a day. The INSTRAW Gender Methodologies database may not be that exciting technically, but it’s possibly the first United Nations installed of CakePHP.

I’m pretty impressed with CakePHP. Well done Bakers! And I can say, the folks on #cakephp were incredibly helpful (more helpful than #rubyonrails) and humored my mostly dumb questions. If PHP is your thing, and you don’t want to enter the Ruby world, check out Cake PHP.

2 Comments

  1. Brain Off » INSTRAW Tech, Take 2: CiviCRM said,

    August 21, 2006 @ 5:24 pm

    […] When this requirement was first floated, we went out and evaluated our options. Commercial, open source, or maybe even develop something in house based on CakePHP. Finding CiviCRM clinched our direction. Free, open source, a distinctive pedigree, with connections to CivicSpace, and led by Don Lobo. I worked with Lobo at Yahoo, and his presence on the project made me confident that it is a solid piece of software, which will be supported in the future. […]

  2. gwoo said,

    August 30, 2006 @ 8:01 pm

    How about a patch for autoLinkUrls?

RSS feed for comments on this post · TrackBack URI

Comments (2)