Skip Menu |

This queue is for tickets about the Config-IniFiles CPAN distribution.

Report information
The Basics
Id: 102339
Status: resolved
Priority: 0/
Queue: Config-IniFiles

People
Owner: Nobody in particular
Requestors: felix.ostmann [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 2.83
Fixed in: 2.83



Subject: new options for a php parse_ini_file compatibility mode
Hello, i am using Perl & PHP in the same project and want to use the same configuration file. Most is working out of the box with Perl Config::IniFiles & PHP parse_ini_file, but there are some PHP specials: # PERL [section] attr=foo=bar attr=2 VS # PHP [section] attr[]='foo=bar' attr[]=2 The best way would be a extra flag to Config::IniFiles like phpcompat => 1 to enable some rewrites after parsing the config. Would you accept such a patch? Have a nice day Felix Ostmann
Hi Felix, On Tue Feb 24 17:59:16 2015, felix.ostmann@gmail.com wrote: Show quoted text
> Hello, > > i am using Perl & PHP in the same project and want to use the same > configuration file.
Well, one note is that perhaps JSON or YAML or something else with a more regular syntax would be better here. However, see below. Show quoted text
> Most is working out of the box with Perl > Config::IniFiles & PHP parse_ini_file, but there are some PHP > specials: > > # PERL > [section] > attr=foo=bar > attr=2 > > > VS > > # PHP > [section] > attr[]='foo=bar' > attr[]=2 > > The best way would be a extra flag to Config::IniFiles like phpcompat > => 1 to enable some rewrites after parsing the config. > > Would you accept such a patch? >
I'll accept such a patch if it is done against the tip of https://bitbucket.org/shlomif/perl-config-inifiles/overview , passes all existing tests, contains some new tests of its own which it also passes, and documents what's going on. This sounds like a useful feature. Note that I'd prefer this option to be "php_compat" instead of "phpcompat". Best regards, — Shlomi Fish
On Wed Feb 25 03:47:58 2015, SHLOMIF wrote: Show quoted text
> Hi Felix, > > On Tue Feb 24 17:59:16 2015, felix.ostmann@gmail.com wrote:
> > Hello, > > > > i am using Perl & PHP in the same project and want to use the same > > configuration file.
> > Well, one note is that perhaps JSON or YAML or something else with a > more regular syntax would be better here. However, see below. >
> > Most is working out of the box with Perl > > Config::IniFiles & PHP parse_ini_file, but there are some PHP > > specials: > > > > # PERL > > [section] > > attr=foo=bar > > attr=2 > > > > > > VS > > > > # PHP > > [section] > > attr[]='foo=bar' > > attr[]=2 > > > > The best way would be a extra flag to Config::IniFiles like phpcompat > > => 1 to enable some rewrites after parsing the config. > > > > Would you accept such a patch? > >
> > I'll accept such a patch if it is done against the tip of > https://bitbucket.org/shlomif/perl-config-inifiles/overview , passes > all existing tests, contains some new tests of its own which it also > passes, and documents what's going on. This sounds like a useful > feature. > > Note that I'd prefer this option to be "php_compat" instead of > "phpcompat". >
Please use https://github.com/shlomif/perl-Config-IniFiles/ instead of the bitbucket repo. Marking this ticket as stalled due to lack of interest and responsiveness. Still would accept a pull-req. Show quoted text
> Best regards, > > — Shlomi Fish
Implemented as https://github.com/shlomif/perl-Config-IniFiles/pull/3 . Thanks! On Tue Nov 21 11:41:47 2017, SHLOMIF wrote: Show quoted text
> On Wed Feb 25 03:47:58 2015, SHLOMIF wrote:
> > Hi Felix, > > > > On Tue Feb 24 17:59:16 2015, felix.ostmann@gmail.com wrote:
> > > Hello, > > > > > > i am using Perl & PHP in the same project and want to use the same > > > configuration file.
> > > > Well, one note is that perhaps JSON or YAML or something else with a > > more regular syntax would be better here. However, see below. > >
> > > Most is working out of the box with Perl > > > Config::IniFiles & PHP parse_ini_file, but there are some PHP > > > specials: > > > > > > # PERL > > > [section] > > > attr=foo=bar > > > attr=2 > > > > > > > > > VS > > > > > > # PHP > > > [section] > > > attr[]='foo=bar' > > > attr[]=2 > > > > > > The best way would be a extra flag to Config::IniFiles like > > > phpcompat > > > => 1 to enable some rewrites after parsing the config. > > > > > > Would you accept such a patch? > > >
> > > > I'll accept such a patch if it is done against the tip of > > https://bitbucket.org/shlomif/perl-config-inifiles/overview , passes > > all existing tests, contains some new tests of its own which it also > > passes, and documents what's going on. This sounds like a useful > > feature. > > > > Note that I'd prefer this option to be "php_compat" instead of > > "phpcompat". > >
> > Please use https://github.com/shlomif/perl-Config-IniFiles/ instead of > the bitbucket repo. Marking this ticket as stalled due to lack of > interest and responsiveness. Still would accept a pull-req. >
> > Best regards, > > > > — Shlomi Fish