The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Smolder::Conf - Smolder configuration module

SYNOPSIS

    # all configuration directives are available as exported subs
    use Smolder::Conf qw(Secret Port);
    $secret = Secret;

    # you can also call get() in Smolder::Conf directly
    $port = Smolder::Conf->get("Port");

    # or you can access them as methods in the Smolder::Conf module
    $port = Smolder::Conf->Port;

DESCRIPTION

This module provides access to the configuration settings in smolder.conf.

Full details on all configuration parameters is available in the configuration document, which you can find at docs/configuration.

METHODS

get_config

Class method that returns the underlying Config::ApacheFormat object.

get

Given a directive name, returns the value (which may be a list) of a configuration directive. Directive names are case-insensitive.

    $value = Smolder::Conf->get("DirectiveName")

    @values = Smolder::Conf->get("DirectiveName")

check

Sanity-check Smolder configuration. This will croak() with an error message if something is wrong with the configuration file.

This is run when the Smolder::Conf loads unless the environment variable "SMOLDER_CONF_NOCHECK" is set to a true value.

template_dir

The directory path for the templates for this install of Smolder

htdocs_dir

The directory path for the htdocs for this install of Smolder

sql_dir

The directory path for the raw SQL files for this install of Smolder

data_dir

The directory path for data directory for this install of Smolder

test_data_dir

The directory path for test data directory for this copy of Smolder

ACCESSOR METHODS

All configuration directives can be accessed as methods themselves.

    my $port = Smolder::Conf->port();

Gets the value of a directive using an autoloaded method. Directive names are case-insensitive.

EXPORTING DIRECTIVES

Each configuration directive can also be accessed as an exported subroutine.

    use Smolder::Conf qw(port FromAddress);
    ...
    my $port = port();
    my $from = FromAddress();

Directive names are case-insensitive. Gets the value of a variable using an exported, autoloaded method. Case-insensitive.