[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4 Database.pm,1.2.2.2,1.2.2.3
From: |
Alan Millar |
Subject: |
[Koha-cvs] CVS: koha/C4 Database.pm,1.2.2.2,1.2.2.3 |
Date: |
Thu, 13 Jun 2002 23:14:08 -0700 |
Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv13796/C4
Modified Files:
Tag: rel-1-2
Database.pm
Log Message:
Parameter check routine for DBI handle
Index: Database.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Database.pm,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -C2 -r1.2.2.2 -r1.2.2.3
*** Database.pm 30 Apr 2002 09:30:52 -0000 1.2.2.2
--- Database.pm 14 Jun 2002 06:13:59 -0000 1.2.2.3
***************
*** 11,15 ****
@ISA = qw(Exporter);
! @EXPORT = qw(&C4Connect);
--- 11,17 ----
@ISA = qw(Exporter);
! @EXPORT = qw(
! &C4Connect &requireDBI
! );
***************
*** 39,43 ****
my $dbh=DBI->connect("DBI:mysql:$database:$hostname",$user,$pass);
return $dbh;
! }
--- 41,60 ----
my $dbh=DBI->connect("DBI:mysql:$database:$hostname",$user,$pass);
return $dbh;
! } # sub C4Connect
!
! #------------------
! # Helper subroutine to make sure database handle was passed properly
! sub requireDBI {
! my (
! $dbh,
! $subrname, # name of calling subroutine
! )address@hidden;
!
! unless ( ref($dbh) =~ /DBI::db/ ) {
! print "<pre>\nERROR: Subroutine $subrname called without proper DBI
handle.\n" .
! "Please contact system administrator.\n</pre>\n";
! die "ERROR: Subroutine $subrname called without proper DBI handle.\n";
! }
! } # sub requireDBI
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4 Database.pm,1.2.2.2,1.2.2.3,
Alan Millar <=