This method was changed in ZF quite a bit: https://github.com/zendframework/zf2/blob/master/library/Zend/Http/PhpEnvironment/Request.php#L466

But I'm not sure what excatly is best. The Zend version seems buggy to me too (line 474 - 478) because `basename($scriptName) === $filename` can never be true as it compares the basename with the full file path...