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

NAME

Rudesind::Config - A class to provide access to configuration file values

SYNOPSIS

  use Rudesind::Config;

  my $config = Rudesind::Config;

  print $config->uri_root;

DESCRIPTION

This class provides an interface for reading the contents of a Rudesind configuration file.

CONSTRUCTOR

When its new() method is called, it looks for a configuration file in the following locations:

  • $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.

METHODS

This class provides a method for each parameter in the configuration file, as well as a number of additional methods.

Required Parameters

  • root_dir

  • data_dir

Other Parameters

  • 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.

  • charset

    Defaults to "UTF-8".

  • admin_password

    Defaults to undef.

  • gallery_columns

    Defaults to 3.

  • thumbnail_max_height

    Defaults to 200.

  • thumbnail_max_width

    Defaults to 200.

  • image_page_max_height

    Defaults to 400.

  • image_page_max_width

    Defaults to 500.

  • error_mode

    Defaults to "fatal".

Additional Methods

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.

  • 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.