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

0

Please provide more info: the file and relevant directory structure. Then I might be able to help you with resolving these problems.

0
Avatar
Permanently deleted user

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:


include_once "INCLUDES/headers.php";

it gives me a warning.

Any ideas?

0

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.

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

Hello Marc,

Is there a way that I can avoid this warning by changing mty settings

You can disable 'Unresolved include' inspection.

unresolved_include_inspection.png

Thank you for feedback!

0
Avatar
Permanently deleted user

Marc,

Looks like I figured out what is wrong - http://youtrack.jetbrains.net/issue/WI-7191
.

Please vote for the issue if it is your case or try to localize the problem in the same way as described in issue.


Thank you for feedback!

0
Avatar
Permanently deleted user

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";

0

请先登录再写评论。