Switching Gears…

We recently started a new project at work that is going to have a major web component involved. While the desktop application part of the project is still in C#/.NET the decision was made to use the LAMP stack for the web side of things. Not going to say that php would have been my first choice but it has been rather interesting applying what I’ve read/learned about the web world in the last 4-5 years to a language I’ve not used in over 4-5 years.

I’d never even heard of the MVC pattern and PHP was in the process of implementing OOP when last I dabbled. I did quite a bit of research on the php framework world and found that it is rather large. I was hoping I’d go to google and search for ‘PHP MVC’ and get like 2 mature options and then maybe/maybe not need another search for “PHP ActiveRecord” and get another couple results. Lets just say that the existing frameworks were as numerous leaves on a tree. CakePHP, phpMVC, codeIgniter, and Mojavi to name a few. Looking for reviews just made it worse. It’s amazing how many “Top 10 MVC Framework” reviews there are that share almost no names. I’ve always found that with OS software you have choices, almost to many, because of branching and people wanting feature X to they start their own project but the choices here were kinda ridiculous!

Then, as it turns out, because of some missing features in the core PHP lang you can’t have a TRUE ActiveRecord like implementation in PHP. There are some libraries out there that do as much as they can but nothing ‘feature complete’. At some point I might take a look at Propel, which appears to be the “leading” ORM type implementation but, as you’ll read below, my final choice has a built in DB access library that takes care of the basic CRUD.

What we finally ended up going with was Zend Framework. It’s by the people at Zend (akin to MS win the PHP world) but more importantly to me was the fact it went beyond just an MVC framework. I don’t have a library of code to pull from in the PHP world so I’d be coding it all from scratch, but with the Zend Framwork you get a complete bundle of libraries that are known to play nice and are feature complete. It has methods for Authenticating and ACL implementations, as well as CAPTCHA libraries, Database Access classes, logging, and the list goes on. Another selling point is how well it plays with others. It is VERY easy to switch out the Zend_* implementation with whatever you want. The very first thing I did was switch out the Zend_View (templating/view rendering) engine for the Smarty templating engine that I was familiar with from the olden days. Very easy and painless. I can see that project X might have a better MVC implementation and project Y might have/be a killer ORM but Zend has full featured implementations of everything and no integration headaches as a bonus. If I need improvements down the road I’ll poke around more but for now, the consistency factor is bigger for this noob.

At some point I might put some code up, but this was meant as more of a “high level” type post, not very much meat :-).

Filed under:Uncategorized

Comments are closed.