From 8e787670654d48eb1b078e9ee7bc351488192f7a 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 --- 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 1a5c037a42..281a3ee3aa 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 c92056c170..0904ccfdfb 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 a7aaa28e2f..c54d85496b 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.11.0