| OurCal documentation | Contained in the OurCal distribution. |
OurCal::Config - a default config reader
image_url = images
template_path = templates
[providers]
providers = default birthday dopplr
[default]
dsn = dbi:SQLite:ourcal
type = dbi
[birthday]
file = ics/birthdays.ics
type = icalendar
[dopplr_cache]
type = cache
dir = .cache
child = dopplr
[dopplr]
file = http://www.dopplr.com/traveller/ical/user/d34dbeefd34dbeefd34dbeefd34dbeefd34dbeef.ics
type = icalendar
Then generic configuration contain key value pairs for non specific config values.
Each provider can have specific config options in a named section.
Must be given a file param which gives a path to an .ini type file.
Returns a hashref containin the config for a give section or the generic config if no name is given.
| OurCal documentation | Contained in the OurCal distribution. |
package OurCal::Config; use strict; use Config::INI::Reader;
sub new { my $class = shift; my %what = @_; die "You must pass in a 'file' option\n" unless defined $what{file}; $what{_config} = Config::INI::Reader->read_file($what{file}); return bless \%what, $class; }
sub config { my $self = shift; my $section = shift || "_"; return $self->{_config}->{$section}; } 1;