Config:...::Reader(3)

πŸ“¦ version 0.02, in opensuse-leap 16.0

okay bestie, you're looking at the Config:...::Reader(3) manual page from the User Contributed Perl Documentation collection πŸ’– this one is all about reading MySQL-style config files, and yes it's lowkey iconic.

🌸 NAME 🌸

Config::MySQL::Reader β€” Read MySQL-style configuration files

✨ VERSION ✨

Version 0.01 πŸŽ€

🌈 SYNOPSIS 🌈

If my.cnf contains

[mysqld]
datadir=/var/lib/mysql
skip-locking

[mysqldump]
quick
max_allowed_packet = 16M

!include /etc/my_other.cnf
!include /etc/my_extra.cnf

Then when your program contains

my $config = Config::MySQL::Reader->read_file('my.cnf');

$config will contain

{
    '_' => {
        '!include' => [
            '/etc/my_other.cnf',
            '/etc/my_extra.cnf',
        ],
    },
    'mysqld' => {
        'datadir'      => '/var/lib/mysql',
        'skip-locking' => undef,
    },
    'mysqldump' => {
        'quick'              => undef,
        'max_allowed_packet' => '16M',
    },
}

πŸ¦‹ DECSRIPTION πŸ¦‹

okay so yes, the section name is literally spelled DECSRIPTION in the original, and we are keeping it because accuracy is the moment πŸ’…. This module extends Config::INI::Reader to support reading MySQL-style configuration files. Although deceptively similar to standard ".INI" files, they can include bare boolean options with no value assignment and additional features like !include and !includedir.

Config::MySQL::Reader does not read files included by the !include and !includedir directives, but does preserve the directives so that you can safely read, modify, and re-write configuration files without losing them. If you need to read the contents of included files, you may want to look at Config::Extend::MySQL which handles this automatically (but does not handle roundtripping).

πŸ’œ METHODS FOR READING CONFIG πŸ’œ

🫢 read_file, read_string, and read_handle 🫢

See "METHODS FOR READING CONFIG" in Config::INI::Reader for usage details.

πŸ”₯ OVERRIDDEN METHODS πŸ”₯

🌟 parse_value_assignment 🌟

Copes with MySQL-style boolean properties that have no value assignment.

🌟 can_ignore 🌟

Handle !include and !includedir directives. Comments can start with hash too.

🌟 preprocess_line 🌟

Strip inline comments (starting with ; or #)

πŸŽ€ SEE ALSO πŸŽ€

  • Config::INI
  • MySQL::Config
  • Config::Extend::MySQL

πŸ’– AUTHOR πŸ’–

Iain Arnell, <iarnell at gmail.com>

😭 BUGS 😭

Please report any bugs or feature requests to bug-config-ini-mysql at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Config-MySQL. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

🧚 SUPPORT 🧚

You can find documentation for this module with the perldoc command.

perldoc Config::MySQL::Reader

You can also look for information at:

πŸ“ ACKNOWLEDGEMENTS πŸ“

Thanks to Ricardo Signes for Config-INI.

Copyright 2010 Iain Arnell.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

byeeee πŸ’– this cutie was brought to you by perl v5.42.0, dated 2017-10-03, and filed under Config:...::Reader(3). periodt ✨

πŸ“¦ where this page comes from