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 <martin.renvoize@ptfs-europe.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2018-05-04 14:26:25 -03:00
parent 98c42b8d5a
commit 5f39d287bc
3 changed files with 3 additions and 3 deletions

View File

@ -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");

View File

@ -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") || '',
);

View File

@ -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")