I want to store my database connection information in a single file, which both PHP and Ruby scripts can use.
Should I use name-value pairs, yaml, xml, or something else?
I want to store my database connection information in a single file, which both PHP and Ruby scripts can use.
Should I use name-value pairs, yaml, xml, or something else?
YAML, XML, JSON, a proper database — any common format will have support on both sides.
YAML is probably a good option - it is very simple to implement, yet it can take you a long way with flexibility.
BTW. Sounds as if you may have some similar problems that are discussed on railsforphp.com Here is the article on PHP and YAML:
I'd suggest JSON. It can be read natively by PHP with json_decode(). Surly Ruby must have some facilities to read JSON. Plus you can read it directly from JavaScript.