0

I'm maintaining a project in PHP and I'm using a .php file (namely "config.php") to hold all my configuration parameters. The file itself defines a multilevel PHP array: so far all I have to do is include() it in my files.

Now I have to write some more scripts in python3, which must read the exact same configuration. I was thinking about YAML as a cross-language configuration file format, but do you guys have a better advice? I want to keep it simple and avoid XML and database.

Edit: I see YAML is not included in standard PHP; what about JSON?

godzillante
  • 1,174
  • 1
  • 17
  • 32

1 Answers1

1

I recommend you to try it with .ini configuration files. You can parse these files natively to an php array with parse_ini_file(). I'm not very good in Python, but maybe this helps: configparser

I do not recommend json, as it's not made to store configurations.

BERNARDO
  • 219
  • 2
  • 12