Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade fully developed project in Symfony 2.0.16 to Symfony 2.1.0?

I have developed a project in symfony2.0.16. Now I would like to upgrade to sysmfony2.1.0.

As I read from https://github.com/symfony/symfony/blob/master/UPGRADE-2.1.md, lots of things has been changed compare to the previous version (2.0).

Do I need to find and replace my old code snippets and refactor them manullay or there is some command or a better way to do so?

For example as mentioned in the upgrade documents:

Before: {{ app.request.session.locale }} or {{ app.session.locale }}

After: {{ app.request.locale }}

Do I really have to refactor (find and replace) all {{ app.request.session.locale }} in my entire huge project to {{ app.request.locale }} ? Any suggestion how to refactor, if this is the only way.

like image 612
pmoubed Avatar asked Feb 20 '23 06:02

pmoubed


2 Answers

As others have stated already, there is no automatic tool that can do that for you, at least from the official develepors of the framework.

The biggest changes have been made on the Form component which has heavily changed since version 2.0. Overall, I know it's a hard task, because you need to find and replace stuff, but in general, it should be a matter of one day or one half day.

Moreover, chances are that you don't use all and every feature that have changed since Symfony 2.0. This means that you won't need to do modification to your code for every point in the upgrade notes.

In my case, what I did was to go for each bullet, check first if I had use the feature, and then go for a search and replace mode.

It should go fairly quickly. It is long but you can do it :)

Good luck, Matt

like image 120
Matt Avatar answered May 08 '23 09:05

Matt


Best way is to create project structure from new version and merge all old features one by one.

like image 26
poojitha Avatar answered May 08 '23 07:05

poojitha