From 5f39d287bc480970c641c42cc79f502a8bae41fc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 4 May 2018 14:26:25 -0300 Subject: [PATCH] Bug 19821: Use database_test entry if exists If the database_test entry exists in the config file we are going to use it. This will be a trick for developers and CI Signed-off-by: Martin Renvoize Signed-off-by: Bouzid Fergani Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart --- C4/Installer.pm | 2 +- Koha/Database.pm | 2 +- installer/install.pl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index 64698fde59..8baca94fdb 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -73,7 +73,7 @@ sub new { my $self = {}; # get basic information from context - $self->{'dbname'} = C4::Context->config("database"); + $self->{'dbname'} = C4::Context->config("database_test") || C4::Context->config("database"); $self->{'dbms'} = C4::Context->config("db_scheme") ? C4::Context->config("db_scheme") : "mysql"; $self->{'hostname'} = C4::Context->config("hostname"); $self->{'port'} = C4::Context->config("port"); diff --git a/Koha/Database.pm b/Koha/Database.pm index 0cedcf99ad..376f910c98 100644 --- a/Koha/Database.pm +++ b/Koha/Database.pm @@ -64,7 +64,7 @@ sub dbh { my $dsn = sprintf( 'dbi:%s:database=%s;host=%s;port=%s', $driver, - $config->get("database"), + $config->get("database_test") || $config->get("database"), $config->get("hostname"), $config->get("port") || '', ); diff --git a/installer/install.pl b/installer/install.pl index cffabec3fe..063832569c 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -54,7 +54,7 @@ if ( defined($language) ) { my $installer = C4::Installer->new(); my %info; -$info{'dbname'} = C4::Context->config("database"); +$info{'dbname'} = C4::Context->config("database_test") || C4::Context->config("database"); $info{'dbms'} = ( C4::Context->config("db_scheme") ? C4::Context->config("db_scheme") -- 2.39.5