Symfony2 Update 2.2 to 2.3

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

Since I only have one project, and I upgraded it from 2.0 to 2.2, basically creating a new one from scratch, I'm a little afraid what should be .

My project is built with a composer.

What code needs to be processed and what exactly do I need to execute? I really can't find this on the symfony site.

+6
source share
1 answer

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

I update one project from 2.1 to 2.3, and it was really painless. Upgrading from 2.0 to 2.1 was very painful. This mainly depends on vendor packages that want to upgrade to new versions.

Update

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

Refresh (some of the deprecated are announced)

  • Parameter
  • trust_proxy_headers is deprecated. See here .

  • MinLength and MaxLength validators are deprecated.

  • Min and Max validators are deprecated.

  • Field form type deleted.

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

Symfony update files (for convenience only)

Little hint

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

+11
source

Source: https://habr.com/ru/post/946590/


All Articles