PHPStorm how to fix "path not found" and "Include expression is not resolved"?

I think the situation 99% familiar to all, but for some reason everyone is silent on how to deal with this?
Let's say project:
/home/user/www/domen.com/
app/
--class.php
--two_class.php
system/
--init.php
index.php

Actually do the include app/class.php in the file system/init.php.
<?php
// Something like this
define('ROOT', __DIR__ . '/app/');
include ROOT . 'class.php';</code-->
<br / > PHPStorm does not understand the ways how the server sees and everything is taken from the root of the project. But I desired a method in which the full path is /home/user/www/domen.com/<br> __DIR__ __FILE__ does not understand and takes the root of your.<br> How to be, do not start the study due to the IDE just a gesture..
July 8th 19 at 11:42
1 answer
July 8th 19 at 11:44
do not use such structures. why do you need the path from the root file system? use a relative path from site root
PS. but better don't do includes and use the new startup mechanism - albertha.Medhur commented on July 8th 19 at 11:47
: duck as I have the same autoloader will start? How do I config the file to the connect class from a file? Then maybe work with files, and these paths need to be - Cheyanne commented on July 8th 19 at 11:50
Yes, and many a hike from the root of the path. You can, of course, be replaced by a relative. But how then would the problems of the new did not come out - Cheyanne commented on July 8th 19 at 11:53
: just now ran into an example about "why?". If you includit for example, config in init.php, and the config is not in the current folder, and the init.php included in index.php, the relative path for the IDE strays. But if she realized the absolute, this will not happen. - Cheyanne commented on July 8th 19 at 11:56
: Actually, PhpStorm understands __DIR__, but does not want to know why you are there handing to define-Oh. - chelsea13 commented on July 8th 19 at 11:59
: for me, so it needs to substitute anything he'll feed in an understandable way. Thus my constant is replaced by a string and is padded to include. This is PHP syntax and wonder why the IDE ignore it - Cheyanne commented on July 8th 19 at 12:02
: if you bought a license to this product you contact the developers. You can tell them that they owe you and what you do not understand. - chelsea13 commented on July 8th 19 at 12:05
: it is clear that no one is using this functionality. And all adjust to IDE. The question remains unresolved.
And license TRIAL - Cheyanne commented on July 8th 19 at 12:08
: well, this is a good occasion to reflect: the program uses the darkness Pecherov, and you need the functionality in it for some reason is not implemented. Are you sure that you one going up? - chelsea13 commented on July 8th 19 at 12:11
list maping manually. they're configured. you can specify which server the folder MapIT an any local. in the General case it is enough to specify in which folder MapIT server site root - albertha.Medhur commented on July 8th 19 at 12:14
at least out of the box it doesn't work
: once set up the mapping. Had the server there for the folder of the project indicated Ruth = the full path. wouldn't start. Still doesn't understand the include ROOT . 'class.php'; - Cheyanne commented on July 8th 19 at 12:17

Find more questions by tags PhpStormPHPIDE