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(
host => $configuration->{database}->{host},
password => $configuration->{database}->{password},
username => $configuration->{database}->{username},
options => [
$configuration->{database}->{options} ?
split(/, */, $configuration->{database}->{options}) :
()
]
options => $configuration->{database}->{options}
);
my $db = AccessCheck::Data::DB->new();
......
......@@ -56,7 +56,7 @@ sub startup {
host => $config->{database}->{host},
password => $config->{database}->{password},
username => $config->{database}->{username},
options => [ $self->string_to_list($config->{database}->{options}) ]
options => $config->{database}->{options}
);
my $theme = $config->{setup}->{templates_theme} || 'default';
......
......@@ -18,7 +18,9 @@ sub register_db {
ChopBlanks => 1,
};
if ($args{options}) {
$options->{$_} = 1 foreach @{$args{options}};
while (my ($key, $value) = each %{$args{options}}) {
$options->{$key} = $value;
}
}
__PACKAGE__->SUPER::register_db (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment