Symfony2 Upgrading 2.2 to 2.3
Asked Answered
V

1

6

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.

Vo answered 5/6, 2013 at 12:44 Comment(0)
D
11

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)

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.

Doubs answered 5/6, 2013 at 13:22 Comment(4)
Sorry, as it's the first time for me: Beside possible code-changes... how do I update symfony. Do I have to replace the existing composer.jar with a new one and do a composer-install? And will the removed packages be removed automatically? OK: Should be something like this: #14925367Vo
Thx. I searched for the files on the symfony-download-page. I think that's not the 'symfony-way', it could be easier :-)Vo
You also need to ensure your app/bootstrap.php.cache file was updated. Composer will usually do this but it does not hurt to check.Scansion
You need to delete the jms/extra entry from security.yml and manually delete the entries for JMSAopBundle in AppKernel.php in order to update without errors >_>Herbart

© 2022 - 2024 — McMap. All rights reserved.