Bizzare "Undefined constant", PS-127.100

Dear all,

I starting to evaluate new wersion of PS and faced a very strange problem.

I have an external file "/usr/share/php/nexxOmnia" , which is a php file I would like to include.
Please have a look on attached screenshots.

Screen Shot 2013-03-19 at 12.06.53 PM.png
IDE actually sees it, but showing me this strange warning:


Is there any way to fix this?

Thanks,
Evgeny

5 comments

Hi Evgeny,

Adding quotes around file name should help:

include 'nexxOMNIA';

0

Thanks for a very prompt reply. Putting quotes helped.

In addition I have another error "Can't resolve target of expression". Actually as it seen from the baloon, IDE can resolve this path.

But for some strange reason, error messasge stays.

In addition I have this too:

(I've seen there was the quite similar problem in the past (http://devnet.jetbrains.com/thread/304955)

And now it's back. Any chance this can be corrected?

Thanks,
Evgeny

0

Well .. if you can edit your files, you may start such include path with specifying current folder first (I mean: require_once './../../file.php') -- may work. But even if it will work -- it's not a proper solution (to edit plenty of files just to satisfy single IDE inspection).

For me:

  1. I use autoloading functionality .. so I virtually have no include/require statements at all (except few places: autoloader itself; bootstrap file etc)
  2. I just disable this inspection altogether -- as far as I see it produces too many false alarms (the "unresolved include" inspection has quite a few pending tickets) in finely working code (even in rather simple examples, like yours) -- "Settings | Inspections | PHP | General | Unresolved include" (or just Alt+Enter on error and proceed from there). At the end fo the day this inspection is not that critical, compared to other functionality (for both devs and users) .. so I understand why it's not focused right now.
0

Oh... Ok, then.

Since the project runs fine, I will probably leave it as is for now and wait for the newer PS releases.

Regards,
Evgeny

0

Here is a solution if you wish to edit your include/require statements:

require_once __DIR__ . '/../../csrest_clients.php';

Don't know if it's actually an acceptable solution for you, though.

0

Please sign in to leave a comment.