PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 29, 2022

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

 January 29, 2022     composer-php, doctrine-orm, symfony     No comments   

Issue

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",

Solution

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.



Answered By - Nicolai Fröhlich
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing