Magic Deployments →
Here’s something that I’ve been playing around with lately on some projects: magic deployments. As the concept evolves, I’ll write a post on it. For now, lemme know if this might be useful to others.
Here’s something that I’ve been playing around with lately on some projects: magic deployments. As the concept evolves, I’ll write a post on it. For now, lemme know if this might be useful to others.
One of our Orlando PHPers emailed me a question today:
I wanted to get your opinion on PHP frameworks. I am getting ready to do a rewrite of my back office (finally) and wanted to use it as a learning opportunity for MVC pattern and maybe even some TDD, and delve into a solid framework. I am thinking of Symphony or Zend…
His requirements and expectations for using a framework were pretty simple and straight-forward, and they jive with a lot of other folks. In his mind, a decent framework should allow him and his team to:
Both Zend Framework and Symfony 2 (hope he’s not looking at the original project) are good choices, and each comes with a laundry list of pros and cons… As does any tool. Before I get started on those, let me make a couple disclaimers. First, I haven’t used Symfony for a large-scale project yet, although I have “evaluated” it on several smaller projects. Second, I adopted Zend Framework as my weapon of choice somewhere around v0.6, the early beta days, and used (and taught) it religiously until around v1.9. I’ve used and supported ZF since but have also added many other tools to my toolbox.
Symfony is really designed as a full-stack framework. There are some optional dependencies, but if you want the full experience, it’s all-in or go home. That being said, if you use the framework the way it’s intended, it’s very easy to “Build Stuff Faster”: for most common CRUD tasks, you’ll just be writing YAML config files and executing a few commands on the console. That leads to rapid development, if you can get on board with the design philosophies… And like writing YAML.
Where Symfony grates me is right there in those highly abstract and configurable everythings. As I heard it said on Twitter once, “I am not a YAML programmer.”
On my last assignment, the team I was leading was evaluating Symfony as a framework. They were very impressed by the initial “Hello World” application and the amount of polish it presented, but they quickly became daunted by the sheer lack of code they were allowed to write. Writing code without the use of the code generator was just not a good idea. I don’t like that.
Don’t get me wrong, I like the “do more, write less” approach, but I do want to write something, just so I get a feel for how things work together. That’s a personal preference, I know, but it’s what stood out to me the most. I know some folks that are very successful with Symfony and basically spend their time writing template code and YAML files, and they make stuff happen very quickly.
Zend Framework is more of a toolkit by comparison. There are few concrete dependencies, even within the framework, and most of those are so configurable that trading out one component for another is trivial, in many cases even well-documented. The developers have taken pains to make things consistent but easily extensible, and the marketing folks evangelists have done much to promote it as the industry standard in PHP.
IMO, one of the failings of ZF has been the weak MVC, though. The FrontController-Controller-Dispatcher components are very well engineered, and the View and Form components (originally from Solar) are so good they can be used stand-alone. There’s a big gaping hole in the M department, though. Yeah, there are some interesting cobbling techniques out there, or you could “just use Doctrine”, as they say. But IMO, the framework should at least toss you a bone.
Despite this failing, I still keep ZF installed (and up to date!) on practically every server I manage, just so I can use the super-useful components that I will probably need. I don’t need the MVC all the time, but that HTTP Client component comes in handy a lot. All that being said, I have done some amazing things with Zend Framework, and I still recommend it… Just get on the 2.0 branch, willya?
Oh yeah. There are a bunch. First, let me tell you that if you’re looking to stay current, only consider PHP frameworks targeting 5.3 or higher, 5.4 whenever possible. While the big number didn’t change, the rules changed significantly. That narrows the field significantly, but still leaves a bunch to choose from.
The extremely smart dude that brought you the Solar project has a new component framework called Aura that is some kind of awesome sauce, and several of the guys from the Cake PHP project are working on lithium, my personal favorite.
Seems like there’s no shortage of PHP frameworks out there these days, so who’s to say that your home-grown one is so bad? One thing all the others have for them, though, is openness: lots of smart people with eyeballs on the code and opinions to express. That’s probably the number one reason to go with a framework. Best of luck.
I use Lithium for PHP projects these days. Maybe you’ll like it, too. ;)