Remove __DIR__ magic global

Using __DIR__ inadvertently resulted in a bump of the required php
version to 5.3.  We want to keep it at 5.2, so use different method.