include / require with DOCUMENT_ROOT and rtrim

Dear JetBreains,

we have to manage an old code base for one of our customers, which contains alot of these:

require_once rtrim($_SERVER['DOCUMENT_ROOT'], '/') . '/module/header.php';

However PhpStorm does not allow me to drill into the header.php file and will not evaluate it's contents.

When I change the require to the following, everything works as expected

require_once $_SERVER['DOCUMENT_ROOT'] . '/module/header.php';

Is there any way to also get the first line to work as expected? As not all webservers append the slash by default, we cannot easily change the code here.

(I did setup the correct value for DOCUMENT_ROOT in the Settings. Before I did that, also the 2nd option did not work, but it started working as soon as I changed that option. But the first is still not working).

Thanks,

Philipp

 

0
1 comment

Not possible by default, unfortunately. You might try this solution: https://stackoverflow.com/q/40212778/8020009 using @see PhpDpc

0

Please sign in to leave a comment.