11
votes

I have a website written in Symfony 1.4. It was my first symfony website and the learning curve was a bit steep for me. It is a fairly complicated website, and I don't want to 'fix it' if its not broken.

Having said that, since sf 1.4 is now legacy code, I will eventually want to port the site to sf 2.0. as a matter of fact, I am relaunching the site early next year, and I want to know if I might just as well bite the bullet and "port" the site from 1.4 to 2.0 in one go.

So, I need to know answers to the following:

  1. How much of what I already know from 1.4 is applicable to 2.0?
  2. Are there any jobeet or askeet type tutorials out there that show how to build an entire app using the sf framework?
  3. Am I mad, thinking of porting a big website in effectively just over a month (working only part time?) - i.e. is the "big bang" approach the wisest/only approach?
3
possible duplicate of Upgrading from symfony1 to symfony2Frosty Z

3 Answers

22
votes

I don't want to 'fix it' if its not broken.

Don't!

Am I mad, thinking of porting a big website in effectively just over a month (working only part time?)

Yes, you are! :)

Symfony2 and symfony 1.4 are wildy different. We're not talking about some updates to symfony 1.x, we're talking about a brand new framework from the ground up. It's really like asking "How hard would it be to switch from symfony 1.4 to Zend Framework/Kohana/Yii/CakePHP/etc...".

I moved a project (in its very early stages) from symfony 1.4 to Symfony2 and found that except for my familiarity of the MVC pattern, not much (if anything) else was transferable from symfony 1.4 to 2. We're talking about new directory structures, new classes, Doctrine 2, the (awesome) Dependency Injection Container, and more.

Symfony2 has its own learning curve, and even though the architecture is better than symfony 1.4, you will be spending a good amount of time going through trial and error and reading the docs.

Symfony2 is great, and I recommend learning it, but do so at a manageable pace. There's a number of tutorials online - check them out and go through the official Symfony2 docs and cookbook when you're ready.

9
votes

@Arms response is fantastic. Even though the answer has been accepted, I thought I'd add a few of my thoughts to the discussion.

I started work on the development of a personal project about a year ago. I chose symfony 1.4 because Symfony 2 wasn't in a stable phase and I was already an expert in symfony 1.4.

After working for a year in my spare time (I work a full time job) and this is what I have (and it's still growing, about 60% done):

  1. 70,000 lines of php code (Doctrine queries, actions, templates)
  2. 10,000 lines of custom javascript code
  3. 3000 lines of YAML

My schema.yml file for example is 872 lines which consists of 62 table definitions.

My routing file is 500 lines.

Moving a schema definition of that size over to Doctrine2 entities would be a mammoth task. It would take me a very long time. If I were to rewrite what I've done now to Symfony2. It would probably take me a year.

Transitioning over my current authentication system (sfDoctrineGuard) over to a symfony2 implementation would also big a big task. All my command line tasks, doctrine queries, templates would have to change.

In fact, everything would have to change. The only thing that would stay the same is the database username and password.

If I had the resources and time I would consider moving over to Symfony2. One of the biggest advantages I'd get is the performance gain and the better architecture that Symfony2 offers.

I work with symfony2 at the moment in my full time job and I like it a lot but there are still certain things which I'm not sure how to achieve in symfony2 which I know how to do in symfony 1.

For the moment, moving over to Symfony2 for my project is a definite NO. I'd like to but as I have said I don't have the time or resources to and plus the application is working very well indeed. Everything has been re-factured and I've been careful with the development to make sure I'm not repeating code.

Also, maintenance of Symfony 1.4 is due to end in about a year.

If it works well then don't change it. Only change it when you have the resources available and you're knowledgeable in Symfony2 to make sure you don't give yourself any headaches.

Best of luck.

4
votes

Symfony 1.4 is not legacy code. It is still fully supported by the Symfony team and has a 3 year support promise which ends at the end of November 2012.