include or require warning
All through my code, I have warnings that "Can't resolve targe of expression". I see that there is a bug report about this, but I didn't really understand the discussion. PHPstorm finds the files just fine, both in the editor and in the debugger. Is there a way that I can avoid this warning by changing mty settings, or something, it's rather annoying, particularly, since I ignore and when there is a really a file missing it, I don't see it.
m
请先登录再写评论。
Please provide more info: the file and relevant directory structure. Then I might be able to help you with resolving these problems.
not sure what to tel you. I have a lot of files in a directory. When I do include on a file in the top level directory it works fine, but when I try to include something like:
it gives me a warning.
Any ideas?
No ideas - inspection mostly work for me for such a simple case as described.
Unless I can exactly reproduce one of your problems I can't investigate further.
I don't even know what to inspect?
I have hundreds of warning like this in my project, makings warnings not particularly useful, since I never get to 0
m
Hello Marc,
You can disable 'Unresolved include' inspection.
Thank you for feedback!
Marc,
Please vote for the issue if it is your case or try to localize the problem in the same way as described in issue.Looks like I figured out what is wrong - http://youtrack.jetbrains.net/issue/WI-7191
.
Thank you for feedback!
Assuming this INCLUDES is a Constant
eg.
include_once "INCLUDES/headers.php";
should be
include_once INCLUDES . "/headers.php";
-------------------------------------------------------------------------
// INCLUDES is the default directory
define('INCLUDES', 'default/');
//Wrong and fails
include_once "INCLUDES/test.php";
//Correct and works
include_once INCLUDES . "test.php";