20 comments

[ 3.3 ms ] story [ 61.0 ms ] thread
I tried out Symfony (1.x) and I'm thankful for it. It's madness drove me to Rails, where I built some amazing stuff with! It was the entry drug that brought me over from php to the great (but at first sight scary) land of Ruby.
Just out of interest, what drove you mad in 1.x? I've been working with it for the last few years and, by far, the most annoying aspect is sfForms, especially when trying to do anything more than simple tasks (e.g. embedding forms).
I for one found the ORM extremely useless and even offensive in Symfony. sfForms was indeed unusable last time I tried it, not to mention everything was just too verbose (I find PlayFramework a lot more comfortable, even though it's a Java framework).

Of course, I have been previously exposed to Django and its kick-ass ORM and to DBIx::Class from Perl, so my standards were pretty high.

Every ORM I've ever used in PHP is junk aside from Doctrine. And Doctrine is only good if you commit fully to it. Tho that's true for most ORM's (I'm looking at you LINQ, you too, Active Record).

The only other acceptable option IMO (in phpland) is the frameworks that implement such a thin and light ORM that it helps you with redundancies without enslaving you to their verbosity and tortured syntax. (Kohana, for example).

But yes, Symfony in particular, using Propel ORM, is hideous.

Edit: I suppose I didn't "bless" somebodies favorite ORM so clipped a downvote. You could just give a counterpoint instead. And really, I did forget about ZendDb, which wasn't all that bad but I never really used it much.

What's so bad about the PHP ORMs? I am curious. I know Propel has improved significantly, and Doctrine 2 as well. Do you have any specific complaints?
Propel is completely different as of 1.6. It doesn't really use the "Criteria" objects any more. (which is probably what they're referring to)

It's much simpler now:

articles = ArticleQuery->where(column = ?, val)->groupBy(column)->limit(10)->find()

I like it, but it's still very resource-heavy.

There are too many unimpressive ORM projects. There's a hundred PHP frameworks and half of them decide to roll their own ORM rather than use and contribute to an existing project.

So you're left with a lot of unsophisticated systems.

Doctrine (PHP), DataMapper (Ruby), SqlAlchemy (Python), LiNQ (.Net), Hibernate (Java). I've used all of these a great deal (except Hibernate, I've not done all that much Java).

All of these projects are sophisticated, complex, impressive. Propel? CakePHP ORM? Or just search php orm -doctrine -propel and look at the 3 dozen results.

These are junk. I'll stand by that assertion. Not because they're PHP, but because they were started often as a part of a larger framework without any respect paid to the fact that an ORM is a very very hard problem to solve.

I got started with Rails after spending some time learning Symfony2. A lot of the knowledge transferred directly over, and Ruby's syntax is cleaner. Better error messages, too. Symfony's configuration over convention approach probably makes it more flexible than Rails, but I inadvertently messed up the configuration (particularly the namespaces) a lot in the time I spent working on it.

Of course, this was with the S2 alphas and betas. They've likely addressed many of the issues I ran into since then.

I've been working with Symfony2 for a while now, and I could say that configuration that is done in YML is pretty simple.

For beginners I belive they have special configuration options.

I agree with your stance on Symfony, but it's important to realize that not every PHP framework is like that. Symfony adds a lot of complexity that doesn't necessarily mean lower development time or later flexibility - whereas many other PHP frameworks take a much simpler approach.

TL;DR: The problem is with Symfony, not PHP as a whole.

Is there another PHP framework you would recommend? I'm about to start looking at Symfony as a replacement for our aging, home-grown PHP framework. I'm partial to Django, but since PHP is a requirement I could use thoughts on PHP alternatives.
i prefer CodeIgniter, myself, when doing PHP development. i like it because it doesn't force you into anything, but if you want to use its helpful features, you can.
Also examine Kohana - originally an offshoot of CodeIgniter, the 3.1 branch is an entirely different animal.

Kohana is more of a "toolkit" kind of framework, where most of the components only rely on a few base classes, but are otherwise surprisingly decoupled.

Kohana Framework. It's completely OOP, 5.2+, and non-magical.
Yii has borrowed a lot from Rails, and slightly improved AR with RelationalActiveRecord.

Of course, it's still PHP, with all of the said inconsistencies.

The comments in this thread seem to be referring to Symfony 1. Symfony2 is completely different.

If PHP is a requirement, you should really check it out.

For smaller projects CodeIgniter is great. It's simple to learn and use, and has excellent documentation (better than Kohana's).
HTTP cache seems to be an important part of Symfony2. Does anyone have experience with that? (either in Symfony or another framework)

Is that the preferred caching method these days?

It's more than important in Symfony2, it's actually the only way to cache data (beside of course memcache etc). And even if you don't have a reverse proxy like Varnish to fully leverage HTTP caching, there is a built-in reverse proxy.
I like both codeigniter & cakephp.

codeigniter is super easy and joy to work with. 1> simple 2> great documentation (most amazing docs i have seen so far) + forum 3> you can not go wrong , its so easy to write apps using it

cakephp because of 1> "bake" utility to generate code from looking at table 2> easy to access database using models classes 3> built in auth component (and few other components at cake bakery)

never needed to look at anywhere else ;)