Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 Upgrading 2.2 to 2.3

I just read about the new Symfony-Release: Symfony-Blog. It says 'Upgrading from 2.2 to 2.3 should be painless.'

As I only have one project and have upgraded that from 2.0 to 2.2 mainly by building-new-from-scratch, I am a little bit afraid of 'should be'.

My project is build with composer.

Which code has to be worked over and what exactly do I have to do migrate? I really can't find that on the symfony-site.

like image 214
Sammy Avatar asked Jun 05 '13 12:06

Sammy


1 Answers

You can read upgrade readme file in symfony repository to see changes that can touch your code.

I am update one project from 2.1 to 2.3 and it was really painless. Update from 2.0 to 2.1 was very painful. Mostly it depends on vendor bundles, which will want to update to new versions.

Update

To update your application you must change you composer.json file. There is a composer.json file from symfony-standard repository. You must change version in your composer.json file and run php composer.phar update. Example to update symfony core change "symfony/symfony": "2.1.*", to "symfony/symfony": "2.3.*". But be careful, there are bundles depending between versions on each other. Example doctrine-bundle v1.1 only works with symfony 2.1

Update(some of founded deprecates)

  • trust_proxy_headers option is deprecated. See here.

  • MinLength and MaxLength validators is deprecated.

  • Min and Max validators is deprecated.

  • Field form type removed.

  • Some old twig blocks like {% block field_row %}, {% block field_label %} also removed(located in form_div_layout.html.twig).

Symfony upgrade files(just for convenience)

  • Symfony framework 2.1 -> 2.2 readme

  • Symfony framework 2.2 -> 2.3 readme

  • symfony-standard 2.1 -> 2.2 readme

  • symfony-standard 2.2 -> 2.3 readme

Small hint

To find the correct version is useful to use https://packagist.org. Example on doctrine-bundle page, you can see which version suitable for 2.3 version.

like image 117
Alexey B. Avatar answered Oct 25 '22 10:10

Alexey B.