From e384001bd258a4e3743e536aab5b113a36a822c7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 10 Feb 2015 10:47:05 +0100 Subject: [PATCH] Bug 13645: Use DBIx::Connector Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall (cherry picked from commit 4883835816ebce164ec336f9adcd4c925f9244b4) Signed-off-by: Chris Cormack Conflicts: C4/Context.pm --- C4/Context.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index c5f92ee91b..3956e1d79b 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -97,7 +97,7 @@ BEGIN { $VERSION = '3.07.00.049'; } -use DBI; +use DBIx::Connector; use ZOOM; use XML::Simple; use C4::Boolean; @@ -782,8 +782,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 -- 2.39.5