How to upgrade project from symfony-2.0 to symfony-2.1

Originally, I created a project on the symfony 2.0 version without the vendors (standard edition). All dependencies were installed by

php bin/vendors install

The project was hosted on the git-repository.

Sidenote: when this post is being written, symfony 2.1 was in beta testing.
However, the main trend has been clear and significant changes in the API was not forthcoming.
One of the key innovations in symfony 2.1 – use Composer .
On the Symfony framework website one can find a description of the process of creating a new bare project, but there is no information about how to upgrade an existing one.

Let’s begin, sir.
Initially I tried to just copy the contents of the file composer.json, located in the root directory of the Symnofy framework hosted on github, and run

php composer.phar update

but there are no all the dependencies required for the normal functioning of the project.
That is why I just decided to create a new “empty” project:

php composer.phar create-project symfony/framework-standard-edition path/

in a separate branch of my git-repository and then merge in changes from the original branch with the version of symfony-2.0.

I confess that I had to resolve conflicts in the files apps/AppKernel.php, files config.yml, security.yml and others.
But it was not too difficult task.
Also, it is necessary to upgrade all of the additional bundles you may use to the appropriate version for symfony-2.1
For example, for FOSUserBundle ( # installation)
add this to you composer.json

    "require": {
        "friendsofsymfony/user-bundle": "*"

and then execute the command

php composer.phar update

Also you need to make changes according to the instruction in the forms files, and other places. But all depends on your situation – what features are being used in your project.

So after all the steps above, the project has started successfully.
One of the first visible changes is added some beauty to the web-debug-toolbar – there appeared tooltips with summary information for each of the sections of toolbar. Those tooltips appear when you hover the mouse on the appropriate icon.

PS: A few days ago I found another method of how to upgrade to symfony-2.1:

5 Replies to “How to upgrade project from symfony-2.0 to symfony-2.1”

  1. А как нащёт обновления symfony-1.1 до symfony-2.1? Интересно было бы почитать:) Понимаю тебе это уже не актуально, но мож что то посоветуеш тем кто мучится со старьем?

    1. Это нереально. Два абсолютно разных фреймворка. И идейно, и архитектурно, и с т.з. использованных технологий.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.