Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2: How to install the dev-master version of Doctrine to resolve "Erroneous data format for unserializing" with composer?

I'm trying to fix Doctrine's Erroneous data format for unserializing bug as referenced here and here.


My composer.json looks like this ...

require: {
    "symfony/symfony": "~2.5",  
    "doctrine/doctrine-bundle": "~1.2", 
    "doctrine/orm": "dev-master",
    "...": "..."
}

... but composer complains that it can't find a matching package:

doctrine/orm dev-master requires doctrine/dbal >=2.5-dev,<2.6-dev -> no matching package found.

How can I resolve the dependencies without forking or raising the minimum-stability in the composer.json?

UPDATE: Nifr's suggestion worked, this is the new config:

"symfony/symfony": "~2.5",
"doctrine/orm": "dev-master",
"doctrine/dbal": "@dev",
"doctrine/common": "@dev",
"doctrine/doctrine-bundle": "@dev",
like image 957
Oli Avatar asked Sep 15 '14 13:09

Oli


1 Answers

You can "whitelist" packages that currently have a lower stability level than the "global" minimum-stability defined in your composer.json by using stability flags.

In order to stop composer from complaining ...

doctrine/orm dev-master requires doctrine/dbal >=2.5-dev,<2.6-dev -> no matching package found.

... just require the doctrine/dbal package explicitly with the @dev stability flag.

Therefore execute ...

composer require doctrine/dbal:@dev

... or add the entry to your composer.json manually:

require: {
   "...": "...",
   "doctrine/orm": "dev-master",
   "doctrine/dbal": "@dev"
}

Repeat this procedure for all dependencies that don't match the global minimum-stability until composer installs without complaining.


Further reading:

Igor W. has published an excellent blog article explaining stability flags in detail.

like image 125
Nicolai Fröhlich Avatar answered Nov 15 '22 09:11

Nicolai Fröhlich