I just started with PHPStorm and I ran into a problem.
Therefore, when you include a file, if you then include another file in it, the path is not understood correctly.
eg. Folder structure:
root/ Contains index.php view/ Contains view.php lib/ Contains functions.php
So, if I include view.php in index.php:
index.php: include('view/view.php'); or require('view/view.php');
When this code is run, anything inside view.php is included in index.php, so any files included in view.php are in the root directory.
view.php: include('lib/functions.php');
But PHPStorm believes that they belong to the view directory.
view.php: include('../lib/functions.php');
In this situation, this is not so.
This issue also occurs for things like: <a href="index.php">Link</a>
How to configure PHPStorm to get this situation? I suggested that this will work automatically, but currently it is not.
Specific example:
private/ privatefile.php public/ index.php views/view1.php //Included in index.php views/view2.php //Included in index.php
Will "public" be the root of the resource in this situation if I want to include privatefile.php in view1.php?
Thus, the include in view1.php will look like this: include ( '../private/privatefile.php' );