开发者

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 an开发者_Python百科d 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.


Pick any of ini, xml, yaml or json. There are libraries for working with any of these formats in Perl and PHP.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜