Donnerstag, 19. Juli 2012

New pecl mongo package breaks mongodb-odm

Using vagrant has many advantages. The fact that every boot updates your packages is not one of them. It  means you might end up with a new version of a package that breaks something even thought your whole setup worked great yesterday.

When booting my vm today, the pecl mongo package 1.2.11 got installed. And it breaks doctrine/mongodb. The error message reads as followed:

Function MongoCollection::setSlaveOkay() is deprecated

As for a solution, Jeremy suggest to set error reporting to not include deprecated messages. This might work for some. People developing symfony2 applications are having a harder time since the kernel sets error_reporting to -1 when in debug mode.

If you are facing this particular error, you should check if error_reporting is excluding deprecated:

error_reporting = E_ALL & ~E_DEPRECATED

To run your symfony2 applications again, you got two options (I came up so far):
  1. Remove the debug mode from dev and test environment
  2. Remove the error_reporting(-1); from the bootstrap.php.cache and you are good to go if you don't rerun bin/vendors install (or php composer.phar install, if you are using composer).
I'm updating this post if the doctrine bundle is working again. Wanna get this news before encountering them. Follow me on twitter!

Keine Kommentare:

Kommentar veröffentlichen