开发者

Which generic module are you using to read MySQL ini configuration file?

There is a lot of modules on CPAN about reading/writing INI files, but every modules I have tested so far (Config::General, Config::IniFiles, Config::Simple, Config::Tiny) failed to read my MySQL my.cnf file.

They all failed because of syntax like this (line with key but without value):

开发者_如何转开发skip-external-locking

So, which module are you using to read MySQL ini configuration file AND other programs ini files ?


I finally decided to patch Config::Tiny to handle non-standard MySQL stuff...

I pushed my modified module on GitHub:

https://github.com/sebthebert/Perl-Shots/blob/master/Modules/Config/Tiny.pm

Diff:

8c8
<   $Config::Tiny::VERSION = '2.12';
---
>   $Config::Tiny::VERSION = '2.13';
66a67,76
>       # Handle 'non-standard' MySQL properties
>       if ( /^\s*([-_a-z]+)\s*$/i ) {
>                   $self->{$ns}->{$1} = 1;
>                   next;
>           }
>       # Drop 'non-standard' MySQL '!include' & '!includedir' directives
>       if ( /^\s*!include(dir)?\s+\S+\s*$/ ) {
>           next;
>       }


I haven't tried it but there is apparently MySQL::Config

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜