Gantry::Conf::Provider::FlatFile::Config::General - Uses Config::General to configure your Gantry application


Gantry documentation Contained in the Gantry distribution.

Index


Code Index:

NAME

Top

Gantry::Conf::Provider::FlatFile::Config::General -- Uses Config::General to configure your Gantry application

SYNOPSIS

Top

use Gantry::Conf::Provider::FlatFile::Config::General;

my $config_hash = Gantry::Conf::Provider::FlatFile::Config::General->config($file);

DESCRIPTION

Top

This is the provider to allow Gantry::Conf to be able to handle Config::General aka Apache style configuration files.

METHODS

Top

config

Returns a config subhash by applying Config::General to a file.

SEE ALSO

Top

Gantry(3), Gantry::Conf(3), Config::General(3)

AUTHOR

Top

Frank Wiles <frank@revsys.com>

COPYRIGHT and LICENSE

Top


Gantry documentation Contained in the Gantry distribution.

package Gantry::Conf::Provider::FlatFile::Config::General; 

#####################################################################
# 
#  Name        :    Gantry::Conf::Provider::FlatFile::Config::General; 
#  Author      :    Frank Wiles <frank@revsys.com> 
#
#  Description :    Gantry::Conf provider that allows the use of
#                   Config::General config files. 
#
#####################################################################

use strict;
use warnings; 

use Carp qw(croak); 

use Config::General; 
use Gantry::Conf::Provider; 
use base qw( Gantry::Conf::Provider ); 

#------------------------------------------------
# config 
#------------------------------------------------
# Configure ourself with a Config::General
# config file 
#------------------------------------------------
sub config { 
    my $self    =   shift; 
    my $file    =   shift; 

    my $config = Config::General->new( $file ) or
        croak "Unable to create Config::General object: $!"; 

    my %confs = $config->getall; 

    return( \%confs ); 

} # END config 

1;

__END__