What is a good plain text configuration file format shared by PHP and Perl?
This is more of a concept question rather than a coding problem to be solved. We have a number of scripts in both PHP and Perl.
There are a large number of MySQL servers spread around the company each with a large subset of different user/permission combos.
I would like to create a central configuration file, maybe as plain text file, that has a list of all the connection data. Each language would need to be able to read the files and parse them into a usable format.
I would like to know any preferred method of implementing this.
Answer
Solution:
Pick any of
,
,
or
. There are libraries for working with any of these formats in Perl and PHP.
Answer
Solution:
For PHP you have parse_ini_file and for Perl you have Config::INI::Reader. Both of these should do you pretty fine and allow structured configuration that's easily editable by humans.