Fix __DIR__ compatibility with PHP < 5.3.