Composing with Symfony
December 12th, 2005 by rickSymfony is a PHP framework that I’ve been evaluating as of late. I’ve looked at Mojavi, Cake, WACT, PHP on Trax in depth, and skimmed over at least 5-6 others from a list I found. Too bad most of them have little more than a neat name… crap. All of it. I know that’s harsh, and I know they’re all trying. But there is NO good reason that on my local machine, a Windows PC none-the-less, and with absolutely no knowledge or experience with either the language or the platform, I was able to install Ruby, Rails, a couple other components and create a decently-functional application in probably 1-2 hours total time. It was that experience that made me want to go out and find a good PHP framework… I just haven’t found one yet…
Symfony has all the features I was looking for:
Separation of business rules, server logic, data layer and presentation.
Works with MySQL along with many others.
Uses the MVC model for the front/admin stuff.
Written in objects (in PHP5)
More importantly, PHP-based.. don’t want to learn a new language.
Templating helpers for forms and form elements.
Smart URLS
Caching
Scaffolding
and AJAX (using Scriptaculous and the prototype libraries) capabilities.
With all this, I don’t see any reason NOT to use it. Mojavi came highly recommended, and in fact, the MVC part of Symfony is Mojavi. Symfony really is just the combination of a bunch of projects that were out there with a lot of nice glue thrown in there.
I imagine this would be relatively easy to work with if I had root access to the server with which I am working, but configuration has been a bit of a pain thus far. All the stuff you need to install is available through PEAR which would make it incredibly easy, if I had access to PEAR. Then there have been some changes needed to httpd.conf and php.ini (for some reason this install had magic_quotes_gpc turned ON *shudder*) which have been roadblocks. But watching a quick tutorial, and comparing this to Rails, it seems to be good. I would totally be using Rails if there was a Rails framework for PHP but alas. Zend is working on a PHP framework, and maybe it won’t suck when it comes out, but for now it looks like Symfony is the most mature framework out there.
Currently, I’m waiting on the sysadmin to add two aliases to httpd.conf, remove magic_quotes_gpc and restart Apache. I’ll post more of my experiences with this as it goes on.
Posted in Technology |

December 13th, 2005 at 3:03 am
Hi Rick,
Concerning the problems with PEAR and root access that you mention, symfony only requires that you have that kind of privileges when developping an application - and you usually do that in your own computer, where you have all privileges. As for the final host, you just need a FTP access to transfer your project files and the framework files. All that is explained in the installation chapter of the symfony book.
By the way, thanks for the review!
December 13th, 2005 at 9:19 am
Francois,
I doubt you will be checking back in on this, but in the off-chance that you do, I have printed out the Symfony Book (should be a good reference for our team going forward if we decide to base our future development all upon Symfony). I have read the installation chapter but must’ve missed the part about not needing those priveleges. Here is the problem:
In order to use the Symfony framework AT ALL in an application, even post-development, you have to have Phing installed at least, correct? We didn’t have that. I realize that I could have just ftp’d the source for Symfony up there instead of PEARing it down, but since I had to have him get Phing anyway… Also, I believe, if I read the installation chapter correctly, and the error messages I’m currently getting, it is important to have magic_quotes_gpc turned off (I cannot believe this server had it turned on anyway), and I will have to have SOME rules inside the httpd.conf file reagardless of whether it’s in development or production, am I not right?
I will re-read the chapter, since as of now, I’ve not gotten Symfony to work at all. I like what the documentation says it has, and the demo video looks great, but it seems that I’m having similar problems with this framework as I have with the other PHP ones. It doesn’t just work out of the box like RoR did; and that’s disappointing, since I KNOW PHP and do not know Ruby at all.
December 13th, 2005 at 3:30 pm
The problem with magic_quotes_gpc being turned on seems to have been the whole problem. I’m currently reading the whole Symfony book and will be building a demo application just to see how it all works. I’ve already done the ‘hello world’ example successfully and am considering something a little more complex as a test run. If all goes well, I know at least our first big internally-developed project will be done with it. We shall see.
December 14th, 2005 at 5:29 am
Rick,
Although it is not a very good practice, symfony can work in a server where the magic_quote_gpc are turned on: You just have to override this setting in the project php.yml configuration file.
As for the Phing problem, it seems like a serious issue to me. Maybe you would like to mention this point in the symfony forum and open a ticket in the trac?
December 14th, 2005 at 11:14 am
Francois,
The only reason I mentioned Phing was honestly because the tutorial I was following at http://www.symfony-project.com/tutorial/my_first_project.html states that you will need to have Phing installed. So, it’s not really that I encountered any sort of problem with that. I did end up getting everything up and running and working well, and only ran into a couple small caveats. I will be making a second post reviewing what I’ve discovered since my first post shortly. Thanks for taking the time to make your presence known; it’s pretty cool to actually see you guys out posting/commenting in the community.
January 26th, 2006 at 10:13 am
Your praise is based on the feature list and watching a video?
January 31st, 2006 at 1:07 pm
I don’t see how you interpret my post as being ‘praise’ persay. You can pull out a couple chunks of what I wrote and it would sound as if it were unadulterated praise, but that’s not the case. I did specify that there were some short-comings it seemed. Specifically I stated that this framework is not even as easy to get going or use as a framework for a language with which I have absolutely no experience. I did get Symfony eventually installed and working, and am considering its use but may not use it since I’m hesitant to use this particular framework just because I have it; I don’t want to be seeing a nail just ’cause I have a hammer, you know. I think for our project we’ll be just using some of the tools (scriptaclous, etc) and writing things from scratch…
Now, having said that… it DOES seem that Symfony is the most usable of the PHP frameworks to which I’ve been exposed… I have gotten it to install and worked with it a little; that combined with the feature list and having watched the demonstration video… I don’t know what else you would like praise to be based upon, but usage, demonstration and confirmation of the existence of desired features do tend to rate high upon my list of evaluation processes.
November 5th, 2007 at 9:34 pm
COOL !!!