Re: [PATCH] Config doesn't parse ini files with directive names containing
| From: | Greg Beaver | Date: | Mon, 11 Oct 2004 10:00:35 +0000 |
| Subject: | Re: [PATCH] Config doesn't parse ini files with directive names containing | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-33762@lists.php.net to get a copy of this message | ||
Jesper Veggerby Hansen wrote:
Hi Guys, Had a problem with Config and it parsing inifiles from Samba (smb.conf) there are 2 problems that caused this problem. Samba uses the yes/no syntax for booleans, which means that using 'inifile' as container type converts all yes/no to 1/0 (or empty), this should be supported by Samba, although it does not appear so in my case. Therefor I tried using 'inicommented' instead, since it does not use parse_ini_file() (which is the one doing the subst.). However 'inicommented' does not support the use of spaces in the directive name, which Samba uses a lot (fx. 'netbios name', 'wins server', etc.). Therefor I changed: preg_match('/^\s*([a-zA-Z0-9_\-\.]*)\s*=\s*(.*)\s*$/', ... To: preg_match('/^\s*([a-zA-Z0-9_\-\.\s]*)\s*=\s*(.*)\s*$/', ... On line 72 in IniCommented.php and it works like a charm, the "patch" is here: http://pear.veggerby.dk/patch/IniCommented.phps Don't know if this was left out on purpose, but for my case it is required for passing the ini file, so I would definitely like to have it included.I wrote the original inicommented driver for use in phpDocumentor (still haven't gotten around to using it yet...) and can tell you this was simply an oversight - didn't occur to me that someone could use spaces in the name. Greg