On Dec 14, 2007, at 4:06 PM, Gary Mort wrote:
I'm curious, is there a reason readini is not used for config files in general? Is it that much faster to include the config.php file as opposed to using readini?

You mean parse_ini_file, right? http://php.net/parse_ini_file

Ini files are more readable than php... but sometimes I think it's nice to have the flexibility of php in my config files to be able to put a little php in them... I guess what I'm thinking it more akin to the bootstrap file concept.

Parse_ini_file is part of the core php code, so it's probably pretty fast. A pure PHP implementation would surely be too slow. I would guess the performance difference with parse_ini_file (if significant) isn't reason enough to not use it if you prize readability... then again... maybe it's worth taking it one step farther and installing syck and the pecl ext/syck extension so you can read/write YAML:
http://www.whytheluckystiff.net/syck/
http://devzone.zend.com/article/2585-Using-YAML-With-PHP-and-PECL



_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to