extending com_config - adding new field and values in Global Configuration

121 views
Skip to first unread message

Rauli Kumpulainen

unread,
Dec 23, 2016, 5:11:08 AM12/23/16
to Joomla! General Development
Hi,

I get the sense you cannot change core components in anyway, except with template over rides.

I wanted to add a field in Global Configuration that included extra in the Jconfig class of configuration.php.

Namely want to set the sessions.save.path and sessions.handler

I would do this by including a __constructor that ran the ini_set statements.

I can add this manually but if you save global configuration in the backend in future you lose these values.

Asking if its possible to create a component, inherit the class used by com_config and modify the save and component render functions so that it would seem like this was native to the global configuration section. Also would like to replace the defaul com_config link, or make a redirect. I seen this happen with a component called Advanced Modules, it redirects to its own component that extends the core module manager.

A client has a problem whereby the redis session handling is too unstable on his webhost and its causing multiple cart sessions to spawn in virtuemart during peak hours when the cloud host juggles running the website between servers in the cluster.

Regards,
Rauli

Mike Smith

unread,
Dec 23, 2016, 5:22:18 AM12/23/16
to joomla-de...@googlegroups.com
Do not mess with any core files since you cannot control what changes may take place in any following update.
If you want to do this then just add your own config_system to your code.

Mike


--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send an email to joomla-dev-general@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

Bakual

unread,
Dec 23, 2016, 2:06:28 PM12/23/16
to Joomla! General Development
You may be able to expand the config form using system plugin events. Haven't tried that.

Rauli Kumpulainen

unread,
Dec 23, 2016, 3:26:46 PM12/23/16
to Joomla! General Development
from what i can tell, all events that plugins can hook onto fire after joomla starts/resumes its own session, so i do not think i can append/edit the jconfig object (if there is one).

Hannes Papenberg

unread,
Dec 23, 2016, 5:03:40 PM12/23/16
to joomla-de...@googlegroups.com
Right, but you can add a plugin that adds a field to the form in the
backend that generates the configuration.php and then Joomla
automatically always adds that field to the backend edit form and the
configuration.php, resulting in you extending configuration.php.

Hannes
> --
> You received this message because you are subscribed to the Google
> Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to joomla-dev-gene...@googlegroups.com
> <mailto:joomla-dev-gene...@googlegroups.com>.
> To post to this group, send email to joomla-de...@googlegroups.com
> <mailto:joomla-de...@googlegroups.com>.

ernest meyer

unread,
Feb 10, 2017, 11:54:40 PM2/10/17
to Joomla! General Development
It is an extremely bad idea to modify the configuration file again. The simplest thing to do is to store custom data in the extensions table, although that is not entirely simple either, it is definitely the most reliable thing to do.

Hannes Papenberg

unread,
Feb 11, 2017, 1:17:01 PM2/11/17
to joomla-de...@googlegroups.com
There are valid reasons to store data in configuration.php and the
solution that I proposed, will ensure that the system can still be
upgraded and that that data is not (unintentionally) lost.

Hannes

ernest meyer

unread,
Feb 11, 2017, 1:39:13 PM2/11/17
to Joomla! General Development
Well maybe I misunderstand your purpose, but what I do with custom data is include it in the extension that needs it. If it is for more general consumption by the framework, then the component, module, or plugin using the information is an appropriate place for it. configuration.php was intended for the joomla installer itself, and if you wish to extend it, then probably you should talk with the  core team members responsible for the installer. I am merely stating the original purpose of the architecture. I dont intend to deflate your ambitions )
Reply all
Reply to author
Forward
0 new messages