PHP on Rails *yawn*
I have no experience with Ruby on Rails I just know the screencast and am reading about all the hype. But I think I know PHP quite well, so I wanted to know how much people had learned from RoR and how it has effected the PHP community, especially concerning frameworks and stuff to make your life easier. Here is an article Rails-inspired PHP frameworks from H3rald, which is not going very much into depth. But from what I read symfony seems very promising, especially because it has I18N support integrated and extensive docs, which I think are musts nowadays. I haven’t worked with neither one of them, but I probably will.
Let me just state that I think the integration of AJAX is pretty neat and comfortable, but when it comes to really dedicated JavaScript stuff I would probably not use it. And the Web2.0 stuff nowadays does really dedicated JavaScript. But we will see how this is evolving …
Edward said,
May 15, 2006 at 5:06 pm
Have a look at QCodo too (www.qcodo.com). It’s not so much a framework as a code generator that really speeds up any PHP project that uses a DB. I’ve been using it for a few weeks now and am seriously impressed.
Jad madi said,
May 15, 2006 at 6:41 pm
I’m in love with CodeIgniter when it comes to small, quick and dirty projects, at least you you still write PHP with it.
h3raLd said,
May 15, 2006 at 7:47 pm
Thanks for mentioning my article. Yes, I deliberately didn’t go too much in depth to keep things simple, but in the end I think CakePHP Symphony and CodeIgniter at least seem very promising. PHP on Trax as well, especially when it comes to switch from PHP to Rails and vice versa.
CakePHP is my favourite, it’s not a mystery, simply because it’s very simple to learn and very powerful. Symfony at the moment offers more features, like i18n, but at a first glance it looks more complex and it has a steeper learning curve… it’s probably suitable for any kind of project as it also bundles *everything* you’ll ever need (prototype, for example).
On a side note, CakePHP docs are pretty much complete now, and the i18n should be more or less done and available in the latest trunk.
Philip Hofstetter said,
May 16, 2006 at 10:36 am
Hi there,
I’m a long (long) time PHP user (since PHP3 in 1997 or 98) and I recently came across Ruby (on Rails) myself. Well… actually I’ve seen a tutorial of a very early rails version in the german Linux Magazin, but it was not nearly as polished then as it is now. And ruby… well I learned the language about 1999 or 2000 after reading about it on the german PHP mailinglist (where that was still the only place to go when you were interested in PHP). THAT far back.
Ruby was never interesting for me as I liked the easy and straightforward deployment PHP provides and because the whole things around the language itself (documentation, libraries) were not nearly as advanced in the ruby world as in the PHP world.
That changed recently. After seeing that famous first screencast just after coding a quite similar framework in PHP. I went ahead and bought that Ruby on Rails book (in beta back then), read it and was surprised how much work Rails is able to take from you while still providing the needed flexiblity.
Shortly after, we did our first project in Rails in about half the time it would have taken to do it in PHP. Granted: It was not much more than providing a closed user group, but such simple things is where Rails really shines over PHP: Simple things are simple to do in Rails. As things grow more complext, both concepts meet again with PHP having some advantages in flexibility and rails in form validation (which everything boils down to).
What remains is the question of style: Personally, I prefer the style of Ruby over PHP. The syntax is foreign to most of us, but you will quickly get used to and do much more stuff with fewer lines of code.
Deployment of that Rails application with FastCGI was very easy and the thing was even faster than Apache/mod_php, though I’m still investigating here. It may be that FastCGI alone is the reason for that (keeping an interpreter in Memory sounds like a good thing to do).
If you want advice on what to use - PHP or Rails: Go with both. Each problem has a solution and for each solution there is a different tool. Prefer working with PHP? Go with PHP. Prefer the syntax of Ruby. Go with Rails.
Philip
Jens Kleikamp said,
May 17, 2006 at 2:48 pm
I took a look at the i18n implementation of symfony but I don´t like it.
I was searching for some good design ideas for i18n solution for our own framework. I like it to use native icu data but I don´t think it scales well if the there are hundred of .dat files with serialized locale info.
Then I came across the first pear i18n package. This package isn´t finished yet, and it is php4, but for me it has a fantactic and slim design. I have learned much from it.
Thanks Wolfram
Wolfram said,
May 17, 2006 at 4:50 pm
oha, the O# i18n pear package, what aspect about it did you like, did you do any further dev on it, what do you see worth diving deeper into? I did not use it for a long time now, may be you can share some experience and further thoughts … i still don’t see _the_ perfect i18n solution anywhere …
and thx for appreciating my work
Jens Kleikamp said,
May 18, 2006 at 12:25 am
Amongst other things I like it to have php objects for each culture, so it is easy to inherit the language properties within country specific locale objects. Additionally I don´t want to store *all* scripts, languages and country-name translations in the locale when I only need locale based numbers and dates all over the place.
The i18n package uses native php functions like number_format and date. Okay, date have to be replaced with strftime but thats not the key point here, usage of native php functions is a good thing.
Thats all, but great, I *was* not sure how to step further until I saw that package!!
Maybe we have to serve a customers web tool in five different langauges, so I don´t have the need of hundred of .dat files which contain information I never need in most of the cases, then I need five well formed locale classes and some good formating tools (DataTime and Numbers).
I am already using the ezTranslation component on the other side of the i18n problem
Sorry for my english, it´s not my mother-locale