JConfig / phpStorm

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Post Reply
mike gaskey
Joomla! Intern
Joomla! Intern
Posts: 53
Joined: Mon Mar 30, 2015 1:14 pm
Location: Indianapolis, IN

JConfig / phpStorm

Post by mike gaskey » Sun Jul 01, 2018 6:35 pm

I have installed phpStorm to use as an IDE for some joomla development. I am using component-creator to get the basics of a component and need to modify what the component-creator creates. With luck, the changes I'll need to make will be simple but I still need an IDE and phpStorm looks to be a good one. However, I am stumped with the setup, it calls for the address of my JConfig file and I have searched my system (joomla is a localhost install using xampp/apache) and I cannot locate the file. The searches returned the locations of various config files, but not JConfig. This is probably a stupid question for some if not all of you but where do I find it?
Last edited by toivo on Sun Jul 01, 2018 10:15 pm, edited 2 times in total.
Reason: mod note: marked as solved
My first programming job: I wrote autocoder (IBM 1400 series machine)

User avatar
toivo
Joomla! Exemplar
Joomla! Exemplar
Posts: 9832
Joined: Thu Feb 15, 2007 5:48 am
Location: Oxford, UK
Contact:

Re: JConfig / phpStorm

Post by toivo » Sun Jul 01, 2018 6:59 pm

Do you mean the file containing the definition of the JConfig class?
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB :)
troubleshooting smtp and other articles https://talikka.com/joomla

mike gaskey
Joomla! Intern
Joomla! Intern
Posts: 53
Joined: Mon Mar 30, 2015 1:14 pm
Location: Indianapolis, IN

Re: JConfig / phpStorm

Post by mike gaskey » Sun Jul 01, 2018 7:03 pm

The message that I get from phpStorm is that I need to provide: "Path to JConfig" - it is a bit obscure but I'll try any suggestion.
My first programming job: I wrote autocoder (IBM 1400 series machine)

User avatar
toivo
Joomla! Exemplar
Joomla! Exemplar
Posts: 9832
Joined: Thu Feb 15, 2007 5:48 am
Location: Oxford, UK
Contact:

Re: JConfig / phpStorm

Post by toivo » Sun Jul 01, 2018 7:43 pm

The class JConfig is defined in the file configuration.php in the main Joomla folder.

Here is how this file is included at the front end by includes/framework.php:

Code: Select all

require_once JPATH_CONFIGURATION . '/configuration.php';
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB :)
troubleshooting smtp and other articles https://talikka.com/joomla

User avatar
toivo
Joomla! Exemplar
Joomla! Exemplar
Posts: 9832
Joined: Thu Feb 15, 2007 5:48 am
Location: Oxford, UK
Contact:

Re: JConfig / phpStorm

Post by toivo » Sun Jul 01, 2018 8:12 pm

The framework has already loaded the class JConfig and therefore your code does not have to know the location of the file. It can just access the configuration variables from the class object, for example:

Code: Select all

$config  = new JConfig();
$mailfrom   = $config->mailfrom;
Last edited by toivo on Sun Jul 01, 2018 10:17 pm, edited 1 time in total.
Reason: typo
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB :)
troubleshooting smtp and other articles https://talikka.com/joomla

mike gaskey
Joomla! Intern
Joomla! Intern
Posts: 53
Joined: Mon Mar 30, 2015 1:14 pm
Location: Indianapolis, IN

Re: JConfig / phpStorm

Post by mike gaskey » Sun Jul 01, 2018 8:37 pm

found it. phpStorm asked as I described, it wanted to know where to find, JConfig. What it should have said was, configuration.php, which I figured out because of your earlier post regarding require_once JPATH_CONFIGURATION

That satisfied phpStorm. Thanks for the help! -Mike
My first programming job: I wrote autocoder (IBM 1400 series machine)


Post Reply

Return to “Joomla! 3.x Coding”