Commit 1a0b2aa7 by Alex Bush

bugfix

1 parent 585df6ae
Showing with 4 additions and 2 deletions
...@@ -12,14 +12,16 @@ my $config = plugin 'Config'; ...@@ -12,14 +12,16 @@ my $config = plugin 'Config';
app->secret($config->{secret} || 'minecraft'); app->secret($config->{secret} || 'minecraft');
plugin charset => {charset => $config->{encoding}}; plugin charset => {charset => $config->{encoding}};
our $dbi;
# Connect to db # Connect to db
if ( $config->{db_driver} eq 'SQLite' ) { if ( $config->{db_driver} eq 'SQLite' ) {
our $dbi = DBIx::Custom->connect( $dbi = DBIx::Custom->connect(
dsn => "dbi:$config->{db_driver}:database=$config->{db}", dsn => "dbi:$config->{db_driver}:database=$config->{db}",
option => {sqlite_unicode => 1}, option => {sqlite_unicode => 1},
); );
} elsif ( $config->{db_driver} eq 'mysql') { } elsif ( $config->{db_driver} eq 'mysql') {
my $dbi = DBIx::Custom->connect( $dbi = DBIx::Custom->connect(
dsn => "dbi:mysql:database=$config->{db};host=$config->{db_host};port=$config->{db_port}", dsn => "dbi:mysql:database=$config->{db};host=$config->{db_host};port=$config->{db_port}",
user => $config->{db_username}, user => $config->{db_username},
password => $config->{db_password}, password => $config->{db_password},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!