supporting php <5.3.6 for file extension read