Ignore:
Timestamp:
Apr 24, 2003, 6:05:34 PM (19 years ago)
Author:
kake
Message:

Finished adding mysql support - no sqlite support yet as it's a bit messier

File:
1 edited

Legend:

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

    r60 r61  
    1212    die "Config::Tiny is required to set up this application.\n" if $@;
    1313
    14     eval "use CGI::Wiki::Setup::Pg";
    15     die "CGI::Wiki is required to set up this application.\n" if $@;
    16 
    1714    my $config = Config::Tiny->read("wiki.conf");
    1815    my $dbname = $config->{_}->{dbname};
     
    2017    my $dbpass = $config->{_}->{dbpass};
    2118    my $dbhost = $config->{_}->{dbhost};
     19    my $dbtype = $config->{_}->{dbtype};
     20
     21    my %cgi_wiki_exts = ( postgres => "Pg",
     22                          mysql    => "MySQL" );
     23
     24    my $cgi_wiki_module = "CGI::Wiki::Setup::" . $cgi_wiki_exts{$dbtype};
     25    eval "require $cgi_wiki_module";
     26    die "CGI::Wiki is required to set up this application.\n" if $@;
    2227
    2328    print "Checking database schema...\n";
    24     CGI::Wiki::Setup::Pg::setup( $dbname, $dbuser, $dbpass, $dbhost );
     29    {
     30        no strict 'refs';
     31        &{$cgi_wiki_module . "::setup"}( $dbname, $dbuser, $dbpass, $dbhost );
     32    }
    2533}
    2634
Note: See TracChangeset for help on using the changeset viewer.