lets say I have a file index.php in the root of my php project. This file looks like
Let's assume in the config.php I do something like
$dbConnection = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8") );
$dbConnection->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
Now I want to access this dbConnection in a pages/xy.php file
This works, but of course I got an unresolved variable warning from the inspector because the inspector could not know, that this file is included by a file in the parent drawer which included the config.php.
Is there any possibility to tell the xy.php file where it can find the $dbConnection to get rid of this warning?