Skip to content
Snippets Groups Projects
Commit d1679059 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

pass database options as an hash, instead of a list

parent 7f52b582
No related branches found
No related tags found
No related merge requests found
...@@ -61,11 +61,7 @@ AccessCheck::Data::DB->register_db( ...@@ -61,11 +61,7 @@ AccessCheck::Data::DB->register_db(
host => $configuration->{database}->{host}, host => $configuration->{database}->{host},
password => $configuration->{database}->{password}, password => $configuration->{database}->{password},
username => $configuration->{database}->{username}, username => $configuration->{database}->{username},
options => [ options => $configuration->{database}->{options}
$configuration->{database}->{options} ?
split(/, */, $configuration->{database}->{options}) :
()
]
); );
my $db = AccessCheck::Data::DB->new(); my $db = AccessCheck::Data::DB->new();
......
...@@ -56,7 +56,7 @@ sub startup { ...@@ -56,7 +56,7 @@ sub startup {
host => $config->{database}->{host}, host => $config->{database}->{host},
password => $config->{database}->{password}, password => $config->{database}->{password},
username => $config->{database}->{username}, username => $config->{database}->{username},
options => [ $self->string_to_list($config->{database}->{options}) ] options => $config->{database}->{options}
); );
my $theme = $config->{setup}->{templates_theme} || 'default'; my $theme = $config->{setup}->{templates_theme} || 'default';
......
...@@ -18,7 +18,9 @@ sub register_db { ...@@ -18,7 +18,9 @@ sub register_db {
ChopBlanks => 1, ChopBlanks => 1,
}; };
if ($args{options}) { if ($args{options}) {
$options->{$_} = 1 foreach @{$args{options}}; while (my ($key, $value) = each %{$args{options}}) {
$options->{$key} = $value;
}
} }
__PACKAGE__->SUPER::register_db ( __PACKAGE__->SUPER::register_db (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment