
Smolder::Conf - Smolder configuration module

# 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;
# give Smolder::Conf some values to override the defaults
Smolder::Conf->init(
Secret => '1Adxd23023s',
Port => 80,
HostName => 'smolder.myorg.com',
LogFile => '/path/to/logs',
);
# pull the conf values from a file
Smolder::Conf->init_from_file('/path/to/conf/file');

This module provides access to the configuration settings in smolder.conf. Smolder tries to have reasonable defaults but they can be overridden when needed.

The following configuration options are available:
Port on which Smolder should listen.
Default: 8080
Host name to listen to.
Default: localhost.localdomain.
Email address from which reports should be sent.
Default: smolder@localhost.localdomain
Hostname through which SMTP mail should be sent.
Default: localhost.localdomain
Log file to write to.
Default: none
The level at which things will start to be logged. Only used if LogFile is set.
Default: warning
File in which to write the PID of the Smolder process. A PidFile is required for smolderctl to work.
Default: none
Source of Smolder's templates.
Default: templates in the share directory
Directory for all Smolder's stored data.
Default: .smolder in the user's home directory
Smolder's HTML documents directory.
Default: htdocs in the share directory
Smolder's SQL directory.
Default: sql in the share directory
XXX
Default: XXX
XXX
Default: 0
XXX
Default: 0
XXX
Default: 0
Number of reports to show per Smolder web screen.
Default: 5
XXX
Default: 0

Override the configuration defaults by providing named-value pairs:
Smolder::Conf->init(
Secret => '1Adxd23023s',
Port => 80,
HostName => 'smolder.myorg.com',
LogFile => '/path/to/logs',
);
Override the configuration defaults by providing a file. Config files are simple lists of name-values pairs. One pair per-line and each name/value is separated by whitespace:
HostName smolder.test
DataDir /var/lib/smolder/
Port 80
FromAddress smolder@smolder.test
TemplateDir /var/share/smolder/templates
HtdocsDir /var/share/smolder/htdocs
SQLDir /var/share/smolder/sql
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');
The directory path for test data directory for this copy of Smolder

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.

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.