Master Symfony2 fundamentals

Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).

Discover the SensioLabs Support

Access to the SensioLabs Competency Center for an exclusive and tailor-made support on Symfony

Fabien Potencier
Symfony 2.1.2 released
by Fabien Potencier – September 20, 2012 – 21 comments

Today, the Doctrine team announced the release of Doctrine 2.3.0. Congrats to them!

That's a good opportunity to release another Symfony 2.1 minor version. Symfony 2.1.2 comes with Doctrine 2.3.0 final and fixes a couple of minor bugs too (nothing to be excited about though).

Symfony 2.1.2 is also yet another release that tries to stabilize our usage of Composer. Jordi fixed a small/annoying/major flaw in the way the composer.lock file worked, and hopefully, we now have a solid foundation to manage our dependencies and to create a new Symfony project.

But first, you must upgrade Composer to its latest version; that's easy enough to achieve:

$ composer.phar self-update

Then, if you want to create a new Symfony project, download an archive or run the following command:

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

Comments RSS

  • Vic Cherubini
    #1 Vic Cherubini said on the 2012/09/20 at 12:55
    There is still something amiss with Composer. I downloaded 2.1.2 without vendors and updated composer.phar.

    I run composer.phar install in the Symfony directory and get:

    'Your lock file is out of sync with your composer.json, run "composer.phar update" to update dependencies'

    This doesn't make me feel good. Additionally, when I add a new bundle to composer.json, I have run composer.phar update to get the new bundles rather than composer.phar install. Doing the update updates all of the packages to developmental packages (for example, Symfony goes to 2.1.3-DEV).

    What am I doing wrong?
  • Georg G
    #2 Georg G said on the 2012/09/20 at 13:02
    I couldn't find out how to upgrade from one 2.1 version to another. Please elaborate!
  • Sebastiaan Stok
    #3 Sebastiaan Stok said on the 2012/09/20 at 13:06
    You can update individual packages by runing: composer update doctrine/doctrine-bundle for instance (multiple names are possible).

    In the previous post someone mentioned a problem with overwriting the lock file.

    Maybe we need a way to merge two composer.lock files?
    Most imported thing would be check to compatibility between packages.
  • Björn Fromme
    #4 Björn Fromme said on the 2012/09/20 at 13:20
    Same here. I can only update by replacing composer.lock and running

    composer.phar update some/dependency

    not to get the DEV versions.
  • Tristan
    #5 Tristan said on the 2012/09/20 at 14:06
    I think there is a solution...

    Manully update your composer.json file with your own dependencies.
    Now try this command :
    composer.phar update nothing
    Composer will compare the json file AND your lock file to update and get your missing files.
    After this operation your composer.lock file will be updated with your dependencies (not the symfony's) and then you can use it for deploy your application.

    Tell me back if it's ok for you.
  • Vic Cherubini
    #6 Vic Cherubini said on the 2012/09/20 at 16:05
    @Tristan Juhé - Thank you! That worked perfectly.
  • Björn Fromme
    #7 Björn Fromme said on the 2012/09/20 at 19:04
    @Tristan: yes, it works, but I think it's the same as my solution because this option (nothing) doesn't exist. I think we need some official guide on how to add dependencies to the standard edition really bad.
  • Mickaël Andrieu
    #8 Mickaël Andrieu said on the 2012/09/20 at 21:12
    Great, I' always impressed how "stable" are the framework, and how easy is the upgrade.

    The only problem is the good support of mongo in Mac OSX, cause BC when I want upgrade PHP to 5.4 (in my view, the php mongo driver is unstable).

    Congrats !
  • Hely Suarez Marin
    #9 Hely Suarez Marin said on the 2012/09/21 at 03:16
    Super good for all the work done, my congratulations and thanks to all those responsible for this to be possible, to comment that it is not possible to open the file from the vendor framework compressed zip extension, an error occurs. Very Thank!!!!!!!
  • Greg Holland
    #10 Greg Holland said on the 2012/09/21 at 03:40
    I'm still struggling with Composer.

    MacBook-Pro:Repos greg$ composer.phar create-project symfony/framework-standard-edition symfony/ 2.1.2
    Installing symfony/framework-standard-edition (v2.1.2)
    - Installing symfony/framework-standard-edition (v2.1.2)
    Downloading: 100%

    Created project in symfony/

    Undefined index: package
  • Oscar Gimenez
    #11 Oscar Gimenez said on the 2012/09/21 at 08:45
    In the Composer Documentation says:
    "To update to the new version, use update command. This will fetch the latest matching versions (according to your composer.json file) and also update the lock file with the new version."

    So maybe we have a concept error (maybe not)
    Instead of having on the composer.lock (cool for testing latest dev):
    "symfony/symfony": "2.1.*",
    "doctrine/orm": ">=2.2.3,<2.4-dev",
    We should have (cool for exact versions):
    "symfony/symfony": "2.1.2",
    "doctrine/orm": "2.3.0",

    So, when we do:
    $ php composer.phar update

    Just updates everything as expected.

    So we would only need to update a few lines (just the numbers) in the composer.lock
  • Willy Tito Sucasaire
    #12 Willy Tito Sucasaire said on the 2012/09/21 at 17:10
    Excellent !!! ... thanks Symfony Team ... :)
  • Toan Nguyen
    #13 Toan Nguyen said on the 2012/09/23 at 06:45
    After running `composer update`, I got Symfony version 2.1.3. Is it correct?
  • Toan Nguyen
    #14 Toan Nguyen said on the 2012/09/23 at 08:00
    I think the best way is get composer.json and composer.lock from and

    Then remove vendor folder, and run 'composer install' again.
  • Ricard Clau
    #15 Ricard Clau said on the 2012/09/23 at 16:46
    I agree with Oscar Jimenez, "stable" branches should be referred in composer.lock and not things like this:

    "require-dev": {
    "twig/twig": ">=1.6.0,<2.0",

    Is it expected that we change this dependency to the exact version we like the most? Or maybe we misunderstood something?

    Please Fabien or any SF2 core members clarify this, there's a lot of people like me that want to upgrade and of course appreciate and support your work on SF2.1 and the versions to come but cannot take risks with production applications and milions of users
  • Rick Mulder
    #16 Rick Mulder said on the 2012/09/24 at 12:41
    Ok, so i did a "composer.phar self-update" and then executed "php composer.phar update".

    My commandline shows a number of updates such as:
    - Updating symfony/symfony 2.1.x-dev (f23fd0 => 727331)
    Checking out 7273311e1fb663ae7f5501f57a52ba9bd4db2ec3

    Have i installed version 2.1.2 now? How can i verify this?
  • Jurgen Van Bouchaute
    #17 Jurgen Van Bouchaute said on the 2012/09/24 at 16:56
    There seems to be a problem with the 2.1.2 update for doctrine when installing on linux :
    When running composer.phar install form the latest composer.lock file :

    - Updating doctrine/common 2.3.x-dev (605b1b => bb0aeb)
    [exec] [RuntimeException]
    [exec] Source directory /data/jenkins/workspace/zzzzz/vendor/doctrine/common has uncommitted changes.
    [exec] Exception trace:
    [exec] () at phar:///data/jenkins/workspace/zzzzz/composer.phar/src/Composer/Downloader/VcsDownloader.php:135
    [exec] Composer\Downloader\VcsDownloader->enforceCleanDirectory() at phar:///data/jenkins/workspace/zzzzz/composer.phar/src/Composer/Downloader/VcsDownloader.php:89

    We cleaned completely the vendor dir before running the install
    Any idea ?
  • Thomas Decaux
    #18 Thomas Decaux said on the 2012/09/25 at 12:45
    Uncommited means you made changes and GIT cannot override theses changes.

    Remove vendor directory, lock file.. and try again

    Or, the BEST solution, create a new directory, run the command line to install Symfony from composer, wait 5 minutes, add your depencies in composer.json, and copy/paste your bundle/configuration !

    Since SF2 is very well "fragmented" it's amazingly easy to import your bundles/config in a fresh install, good job @Symfony !
  • Ahmad Jawad
    #19 Ahmad Jawad said on the 2012/09/28 at 14:21

    php composer.phar update is updating vendors to development version.

    After some research, I found out that we can ask composer to update to stable versions only. Here is how I did it

    1) Open composer.json file
    2) Near the bottom you will find "minimum-stability": "dev"
    3) Change it to "minimum-stability": "stable"

    Now run php composer.phar install. It will only install Stable software versions.

    I hope this helps someone.
  • S. Ortet
    #20 S. Ortet said on the 2012/10/06 at 15:42
    It seems there's a problem with flash messages. Templating helper got reverted to 2.0 or something?

    Call to undefined method Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper::getFlashBag()
  • Elias Anzula
    #21 Elias Anzula said on the 2012/10/06 at 17:38
    Download links for tgz and zip files for the standard edition with vendors result to broken files. This happened a few times in the 2.0 branch as well.

    I admire and appreciate the hardwork, but please get the simple things right first.