__DIR__ changed to dirname(__FILE__) for php 5.2 compat