Bug 13645: Use DBIx::Connector

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
This commit is contained in:
Jonathan Druart 2015-02-10 10:47:05 +01:00 committed by Mason James
parent 462626ea9d
commit ac2bf70ac3
1 changed files with 9 additions and 3 deletions

View File

@ -97,7 +97,8 @@ BEGIN {
$VERSION = '3.07.00.049';
}
use DBI;
use DBIx::Connector;
use Encode;
use ZOOM;
use XML::Simple;
use C4::Boolean;
@ -799,8 +800,13 @@ sub _new_dbh
my $db_user = $context->config("user");
my $db_passwd = $context->config("pass");
# MJR added or die here, as we can't work without dbh
my $dbh = DBI->connect("DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",
$db_user, $db_passwd, {'RaiseError' => $ENV{DEBUG}?1:0 }) or die $DBI::errstr;
my $dbh = DBIx::Connector->connect(
"dbi:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",
$db_user, $db_passwd,
{
'RaiseError' => $ENV{DEBUG} ? 1 : 0
}
);
# Check for the existence of a systempreference table; if we don't have this, we don't
# have a valid database and should not set RaiseError in order to allow the installer