Const variables, show path
Hello, can you help me please, how to let PHPSTorm known a path to files when using variables, constants ?
For example i set:
require_once $SERVER['DOCUMENT_ROOT']."/_const/base.php;
and this works, but PHPStorm highlights word '_const' like, Path '_const' not found. But how can i fix this ?
Please sign in to leave a comment.
Hi there,
It's not possible -- currently PhpStorm cannot not evaluate what $_SERVER['DOCUMENT_ROOT'] is (such info is only available during runtime) -- http://youtrack.jetbrains.com/issue/WI-3321
Your only solution right now is to either disable this inspection completely (it does not do much anyway) -- Settings | Inspections | PHP | General | Unresolved Include
.. or just suppress it for that line only:
Final result would be:
P.S.
BTW -- I assume you have typo there as it should be $_SERVER instead of $SERVER
Okay, i got it. Thank you ;)
Yeap, sorry, my mistake - not "$SERVER", but $_SERVER .