Rudesind::Config - A class to provide access to configuration file values
use Rudesind::Config; my $config = Rudesind::Config; print $config->uri_root;
This class provides an interface for reading the contents of a Rudesind configuration file.
When its new() method is called, it looks for a configuration file in the following locations:
new()
$ENV{RUDESIND_CONFIG}
$ENV{HOME}/.Rudesind.conf
/etc/Rudesind.conf
/etc/Rudesind/Rudesind.conf
/opt/Rudesind/Rudesind.conf
If no file is found, it will die. If the file it finds does not contain a required parameter, it will also die.
This class provides a method for each parameter in the configuration file, as well as a number of additional methods.
root_dir
data_dir
uri_root
Defaults to /Rudesind.
image_uri_root
Defaults to an empty string.
raw_image_subdir
Defaults to /images.
view
Defaults to "default".
temp_dir
Defaults to File::Spec->tmpdir.
File::Spec->tmpdir
charset
Defaults to "UTF-8".
admin_password
Defaults to undef.
undef
gallery_columns
Defaults to 3.
thumbnail_max_height
Defaults to 200.
thumbnail_max_width
image_page_max_height
Defaults to 400.
image_page_max_width
Defaults to 500.
error_mode
Defaults to "fatal".
This class provides the following additional methods:
config_file()
Returns the filesystem path to the configuration file the object represents.
comp_root()
Returns either a string or an array reference which can be passed to the HTML::Mason::Interp constructor. The component root is based on the value of the "view" parameter.
HTML::Mason::Interp
main_comp_root()
Returns the filesystem path to the first component root (in case there is more than one). If there is only one, this is the same as calling comp_root().
image_dir()
Returns the filesystem path to the raw image directory.
image_cache_dir()
Returns the filesystem path to the image cache directory.
To install Rudesind, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rudesind
CPAN shell
perl -MCPAN -e shell install Rudesind
For more information on module installation, please visit the detailed CPAN module installation guide.