Changeset 621


Ignore:
Timestamp:
Jan 29, 2005, 2:08:30 AM (14 years ago)
Author:
Dominic Hargreaves
Message:

Use environment variable OPENGUIDES_CONFIG_FILE for config file location;
will be useful for mod_perl. Also add error checking to OpenGuides::Config
config file opening.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides/Config.pm

    r620 r621  
    8383    my %stored;
    8484    if ( $args{file} ) {
    85         my $read_config = Config::Tiny->read( $args{file} );
     85        my $read_config = Config::Tiny->read( $args{file} ) or
     86            die "Cannot read config file $args{file}";
    8687        %stored = $read_config ? %{ $read_config->{_} } : ();
    8788    } elsif ( $args{vars} ) {
  • trunk/newpage.cgi

    r620 r621  
    1414
    1515my $q = CGI->new;
    16 my $config = OpenGuides::Config->new( file => "wiki.conf" );
     16my $config_file = $ENV{OPENGUIDES_CONFIG_FILE} || "wiki.conf";
     17my $config = OpenGuides::Config->new( file => $config_file );
    1718my $wiki = OpenGuides::Utils->make_wiki_object( config => $config );
    1819
  • trunk/preferences.cgi

    r620 r621  
    1010use OpenGuides::Template;
    1111
    12 my $config = OpenGuides::Config->new( file => "wiki.conf" );
     12my $config_file = $ENV{OPENGUIDES_CONFIG_FILE} || "wiki.conf";
     13my $config = OpenGuides::Config->new( file => $config_file );
    1314my $wiki = OpenGuides::Utils->make_wiki_object( config => $config );
    1415my $cgi = CGI->new();
  • trunk/supersearch.cgi

    r620 r621  
    88use OpenGuides::SuperSearch;
    99
    10 my $config = OpenGuides::Config->new( file => "wiki.conf" );
     10my $config_file = $ENV{OPENGUIDES_CONFIG_FILE} || "wiki.conf";
     11my $config = OpenGuides::Config->new( file => $config_file );
    1112my $search = OpenGuides::SuperSearch->new( config => $config );
    1213my %vars = CGI::Vars();
  • trunk/wiki.cgi

    r620 r621  
    2121use URI::Escape;
    2222
    23 my $config = OpenGuides::Config->new( file => "wiki.conf" );
     23my $config_file = $ENV{OPENGUIDES_CONFIG_FILE} || "wiki.conf";
     24my $config = OpenGuides::Config->new( file => $config_file );
    2425
    2526my $script_name = $config->script_name;
Note: See TracChangeset for help on using the changeset viewer.