Monthly Archives: May 2011

Disabling foreign keys in MySQL

Sometimes you want to perform some action on your database which needs foreign keys to be disabled. Luckily this is very easy in MySQL :

SET FOREIGN_KEY_CHECKS=0; # disable all foreign keys

# ... perform your sql magic

SET FOREIGN_KEY_CHECKS=1; # enable all foreign keys

My first experience with Symfony2

After trying the Symfony2 framework for some days, setting up a little project with security, ORM and routing, I have found some things in the manual that were not entirely clear (or sometimes just wrong, I think). Of course it is still in beta, so I’m not blaming anyone but myself… And don’t get me wrong, I will continue using Symfony2 as it is very easy and clear to use.


Translations don’t seem to work outside bundles. I tried creating a translation file in the app/Resources/translations folder, but Symfony2 doesn’t seem to pick it up. It does work inside bundles, so this is not really a problem for me. Don’t know of it is intended behavior either.
Read more »

Installing the INTL extension on MAMP

I just started developing in Symfony2, and the installation told me I should install the Intl extension ( for internationalization. Although Symfony2 works without the extension, I suspect I will run into problems sooner or later, e.g. when using the translation service. So after trying some different ways to compile and install the extension, I finally found that it is fairly easy using Macports.
Read more »

Installing Xapian for PHP on Linux (Debian)

Unlike installation of Xapian on OS-X for use with MAMP, the installation on Debian could not be more simple :

sudo apt-get install php5-xapian

Then restart your Apache server

sudo /etc/init.d/apache2 restart

And you’re done :)
Check phpinfo, there should be a section on Xapian now.