The Joomla configuration file is not only used by Joomla but also PhpStorm uses it to understand how your Joomla site is setup. The configuration file helps PhpStorm to add extra features to the editor.
The extra features that are added are:
- Create database connection
- DatabaseQuery completion
PhpStorm expects only one configuration.php to be present in your installation. If there are other JConfig classes available in your installation they should be disabled.
Finding out if you have more than one JConfig class available:
- Open any PHP file in your project
- Add the following code, this instantiates the JConfig class
- On the JConfig hit CTRL-B / CMD-B to see if you get multiple references like this:
- In this case PhpStorm finds 2 files where the JConfig class is defined. The first entry is the correct one, so we need to disable the second one as that is just a test class.
To disable a file take these steps:
- Open the file with the JConfig class that should be ignored
- Hit CTRL-SHIFT-A / CMD-SHIFT-A to open the Search action field
- Type in the search box Mark as Plain Text
- Select the option or hit Enter
- The file will now lose the highlighting
- The file is now ignored by PhpStorm
Now that there is only one JConfig available, PhpStorm will use this to make the features available.