Quantcast
Channel: The Weber Report » PHP
Viewing all articles
Browse latest Browse all 11

PHP Web Frameworks: CakePHP Versus Symfony

$
0
0

cakephp.gifOver the last few weeks, I have been attempting to learn two major PHP frameworks: Symfony & CakePHP.

Originally, I had decided (in a bit of short-sighted wisdom) that Symfony was the obvious champion. I think I may have been wrong. I spent nearly a week tinkering with Symfony off and on. I came to a simple conclusion: I’m confused.

The Symfony framework is so huge and poorly supported that it confused the heck out of me. Their basic “sandbox” tutorial doesn’t work in any way close to what the documentation states. And the documentation, oh the documentation; what could be the best part of this huge framework fails because of one fatal flaw: no one updates it for the new each new revision that (sarcastically) seems to come out every other day.

After seeing my co-worker struggle with the installation process for days and my own copy just barely functional (with hardly a thing to show from it), I called it quits. At least until I read this (from The Symfony Blog):

“You know that we spent the last months writing a complete guide for
symfony that will be released in bookshops on January 29th. We also
mentioned the fact that the content of this book would become the
official symfony online documentation and be published in HTML on the
same date.”

So, it looks like I’ll put Symfony off until this new-fangled documentation goes live, then I’ll give it another swing.

In the mean time, I’ve been working with CakePHP and genuinely lovin’ it. After tinkering around with it for a while, here are my thoughts about the two frameworks:

Documentation
- CakePHP: Up to date, but not totally complete and somewhat difficult to search through. They also have an extremely helpful CakePHP Google Group that helped most problems I ran into quickly (almost instantaneously during normal business hours) and efficiently. You can’t beat live support that’s free.
- Symfony: Until the new release, not all that helpful because much of the content is dated. However, what is there is easily searchable and they have an active forum that seems to be full of knowleable (yet somewhat arrogant) people.

Installation
- CakePHP: Very easy to install. For the most part, just copy it into your web root and you are good to go (provided you have Apache and mod re-write previously enabled). Once it’s in there, all you really have to do is setup the DB connection and you can be off and running.

- Symfony: Ouch… this is my major sticking point here. I know people that would say, “If it’s not hard, it’s not worth doing”. I agree with that idea, but this is one tough cookie to crack. There are so many little tricks, files, variables, and directory permissions to set-up… it’s a wonder I even got to the point I did. Their basic tutorial, “my first project“, wouldn’t work by following the given instructions… no matter what I did. They also rely on Pear to deliver the goods, which is inherently fraught with little tricks to keep it all running smoothly.

Directory Structure
- CakePHP: It makes sense and it’s extremely logical for almost anyone. You don’t have to be the creator of the framework to understand what each directory is used for. The framework code is in a separate directory totally away from all of your own code. Props to these guys, it works well.

- Symfony: File and directory overload. We’re talking a huge amalgamation of directories buried within directories and files scattered all over the place. When I started really digging, it left me dazed. Truthfully, after spending countless hours working with Symfony, I still haven’t figured out what all the directories are there for (which could be because the framework kinda mixes it’s own libraries in with the programmer’s code).

I could go on for hours, but I think you get the picture. For the time being, I have revised my opinion on the matter of PHP web frameworks. In my somewhat humble opinion, I think CakePHP is the current champion. However, Symfony may present some good competition just as soon as their new release comes out on the January 27th, 2007. Only time will tell I suppose. Rest assured, I’ll be choosing one or the other.

UPDATE: My mind is made up – CakePHP wins! Please read this, and this.


Viewing all articles
Browse latest Browse all 11

Trending Articles