X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=C4%2FContext.pm;h=ca7316b07da1820a9836918b43472f1968c1752d;hb=908c515771b458bfc6d4aa1f43f66093964df6cc;hp=48bf9a6816eaad6f3de3e5d95cd69dff4a9316a6;hpb=88451107aeb037f78ef63b6af66f4f23ec4a4dc1;p=koha.git diff --git a/C4/Context.pm b/C4/Context.pm index 48bf9a6816..ca7316b07d 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -17,6 +17,7 @@ package C4::Context; # Suite 330, Boston, MA 02111-1307 USA use strict; +use vars qw($VERSION $AUTOLOAD $context @context_stack); BEGIN { if ($ENV{'HTTP_USER_AGENT'}) { @@ -51,18 +52,14 @@ BEGIN { } CGI::Carp->set_message(\&handle_errors); } # else there is no browser to send fatals to! + $VERSION = '3.00.00.036'; } use DBI; use ZOOM; use XML::Simple; - use C4::Boolean; -use vars qw($VERSION $AUTOLOAD $context @context_stack); - -$VERSION = '3.00.00.036'; - =head1 NAME C4::Context - Maintain and manipulate the context of a Koha script @@ -600,8 +597,9 @@ sub _new_dbh $db_port = "" unless defined $db_port; 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); + $db_user, $db_passwd) or die $DBI::errstr; if ( $db_driver eq 'mysql' ) { # Koha 3.0 is utf-8, so force utf8 communication between mySQL and koha, whatever the mysql default config. # this is better than modifying my.cnf (and forcing all communications to be in utf8)