#176 Change configuration to separate files

General (30)

For my company it was needed to get the per server config in seperated files. So i edited conf/config.inc.php and removed all the $conf['servers'][0][vars] references and replaced it with:

foreach (glob($confdir . "*.php") as $filename) {

In the conf.d directory i created a file 0000default.php with the following code:
$conf['servers'][$snum]['desc'] = 'Server description';
$conf['servers'][$snum]['host'] = '';
$conf['servers'][$snum]['port'] = 5432;
$conf['servers'][$snum]['sslmode'] = 'allow';
$conf['servers'][$snum]['defaultdb'] = 'template1';
$conf['servers'][$snum]['pg_dump_path'] = '/usr/bin/pg_dump';
$conf['servers'][$snum]['pg_dumpall_path'] = '/usr/bin/pg_dumpall';
$conf['servers'][$snum]['slony_support'] = false;
$conf['servers'][$snum]['slony_sql'] = '/usr/share/pgsql';

hence, the per server config is removed from the main config file. This way version control and distributed configuration management (like with puppet) is much easier for us.

I already posted this in a mailing list and this was the answer:

Splitting configuration files might be a good idea yes. However, I have
two concerns:

* how confusing it could be for users to have multiple configuration
files ? Today, some of them barely read (when they read it) the only
configuration file...
* security issue. If including any kind of PHP files from this folder,
it might lead to a security issue where any kind PHP of code might be

The second point could be solved by using ini files instead of plain PHP.

> Is there a change this minor change will make it to the next release?

Considering the security issue, no, it will not be included in the next

However, if moving to ini file, yes, we could probably consider it it
there's no other issue. We just need to rethink the whole conf file

Could you please post a feature request on sf.net if possible ?


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks