[Koha-cvs] CVS: koha/C4 Database.pm,1.3,1.4

Steve Tonnesen tonnesen at users.sourceforge.net
Thu Jun 20 19:57:14 CEST 2002


Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv21564/C4

Modified Files:
	Database.pm 
Log Message:
merges from rel-1-2.   Starting to get a little longer now.  Being very
careful.


Index: Database.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Database.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Database.pm	30 Apr 2002 09:21:03 -0000	1.3
--- Database.pm	20 Jun 2002 17:57:11 -0000	1.4
***************
*** 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
!     )=@_;
! 
!     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
  
  





More information about the Koha-cvs mailing list