From 62558979aec995f9cded98d27afe14ff054f82cf 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 --- 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 a1c47149f8..98c772151a 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -69,7 +69,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 ea8a10a9bb..1ccaaf7379 100644 --- a/Koha/Database.pm +++ b/Koha/Database.pm @@ -53,7 +53,7 @@ sub _new_schema { my $db_driver = $context->{db_driver}; - my $db_name = $context->config("database"); + my $db_name = $context->config("database_test") || $context->config("database"); my $db_host = $context->config("hostname"); my $db_port = $context->config("port") || ''; my $db_user = $context->config("user"); diff --git a/installer/install.pl b/installer/install.pl index 2c4c2eda91..4c0495265c 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -56,7 +56,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.19.1