remove unused variables by default(config)php

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
olape
Posts: 1626
Joined: Fri Mar 13, 2015 8:47 am
Contact:

remove unused variables by default(config)php

Post by olape » Thu Jan 07, 2021 12:45 pm

Would it make sense to create the possibility by default.php for languages or by defaultconfig.php for the system and for plugins no longer needed variables also remove again.

cmb
Posts: 13518
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: remove unused variables by default(config)php

Post by cmb » Thu Jan 07, 2021 1:49 pm

I don't think we should do that, since that might swallow custom modifications.
Christoph M. Becker – Plugins for CMSimple_XH

olape
Posts: 1626
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: remove unused variables by default(config)php

Post by olape » Thu Jan 07, 2021 7:59 pm

ok, you are right about languages.
But (default)config.php?
How likely is it that someone has their own variables in there.
And if they do, then an update is unlikely anyway, because changes have been made.

cmb
Posts: 13518
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: remove unused variables by default(config)php

Post by cmb » Thu Jan 07, 2021 10:50 pm

As I understand it, Peter Harteg never envisioned plugins, but instead it was encouraged to add custom entries to config.php and the language files. Okay, that was long ago, but some may still do that (perhaps some configs for templates).

On the other hand, what do we win be removing a few outdated config options and language strings? Assuming users do the migration to a newer minor/major version every few years, there shouldn't be much garbage in those files.
Christoph M. Becker – Plugins for CMSimple_XH

olape
Posts: 1626
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: remove unused variables by default(config)php

Post by olape » Fri Jan 08, 2021 6:44 am

cmb wrote:
Thu Jan 07, 2021 10:50 pm
On the other hand, what do we win be removing a few outdated config options and language strings? Assuming users do the migration to a newer minor/major version every few years, there shouldn't be much garbage in those files.
Well, it can sometimes accumulate quite a bit.

For example, I had recently changed some things in Ogra_XH and as a result also renamed config variables. (A careless naming from the first versions).

With such an option it would have been possible to update the config via the backend alone.
Transfer settings to the new variables, then upload new defaultconfig and the old variables would have disappeared.
So you have to rename the existing variables a bit more cumbersome, or there remain (as in this case about 10 - 12) old variables in the configuration.
This makes it confusing.

cmb
Posts: 13518
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: remove unused variables by default(config)php

Post by cmb » Thu Jan 28, 2021 11:31 pm

olape wrote:
Fri Jan 08, 2021 6:44 am
For example, I had recently changed some things in Ogra_XH and as a result also renamed config variables. (A careless naming from the first versions).
I guess, in this case I would have kept the old config var names until the next major version, and would have required users to do a migration to that new major version (like we often do for minor XH versions).

An alternative would be to add special support for the configuration change to the plugin, similar to what svasti did for several of his plugins. I'm not a big fan of doing that, but for some temporary solution that's not so bad.

Or maybe just ship a stand-alone update script which modifies config.php as desired.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply