Re: [PATCH] Config doesn't parse ini files with directive names containing spaces
| From: | Ryan King | Date: | Fri, 08 Oct 2004 16:33:18 +0000 |
| Subject: | Re: [PATCH] Config doesn't parse ini files with directive names containing spaces | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-33711@lists.php.net to get a copy of this message | ||
Great-
I'll make this fix as soon as I can get some cvs karma from the php group.
-ryan
On Oct 8, 2004, at 3:23 AM, 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. Regards Jesper Veggerby Hansen -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php------------------- "There are only the pursued, the pursuing, the busy and the tired." - The Great Gatsby http://theryanking.com