What is a good plain text configuration file format shared by PHP and Perl?

689

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.

402

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.

People are also looking for solutions to the problem: PHP: Percentage of a number

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.