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!

Dienstag, 17. Juli 2012

Web Development with vagrant and chef

If you are like me, you got your development environment set up the straightforward way. Everything is running local (including any lampp/xampp/wampp stack), you may have a git repository with your source code and some IDE or prefered editor to edit your files. There are many problems related to this approach, one which you encounter as soon as your project gets a bit more complex.

I faced this problem when I started working for a small software company while studing. I should work on a Java application which served a webshop-like aftersales website for one of the biggest German automotive companies. I spend almost an entire week setting up my PC so I could run the project in my browser. I got it working, but there where some bugs which did not occur on the other developers PC. I lost another week trying to solve this. And, and this was real fun, parts of the software didn't behave like on the production servers. The main problem was that nobody could tell me the exact steps to set up an environment which worked. It was all like "Well, you need JBoss" and "I have PostgreSQL installed that way, maybe that's the problem". You can imagine my frustration from day 1.

So, if the above describes your setup, you may want to think about doing it another way.