From e725ce8d27ee8eb94abcb14e4838ea52dc04c9bf Mon Sep 17 00:00:00 2001 From: tonnesen Date: Fri, 12 Jul 2002 23:58:35 +0000 Subject: [PATCH] I had Koha.pm using Database.pm and vice versa. Subroutines don't get exported properly when this is done. Moved configfile subroutine to Database.pm --- C4/Database.pm | 22 ++++++++++++++++++++++ C4/Koha.pm | 21 --------------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/C4/Database.pm b/C4/Database.pm index af7c4c2bc3..0d557a862d 100755 --- a/C4/Database.pm +++ b/C4/Database.pm @@ -13,9 +13,31 @@ $VERSION = 0.01; @ISA = qw(Exporter); @EXPORT = qw( &C4Connect &requireDBI + &configfile ); +sub configfile { + my $configfile; + open (KC, "/etc/koha.conf"); + while () { + chomp; + (next) if (/^\s*#/); + if (/(.*)\s*=\s*(.*)/) { + my $variable=$1; + my $value=$2; + # Clean up white space at beginning and end + $variable=~s/^\s*//g; + $variable=~s/\s*$//g; + $value=~s/^\s*//g; + $value=~s/\s*$//g; + $configfile->{$variable}=$value; + } + } + return $configfile; +} + + sub C4Connect { my $dbname="c4"; my ($database,$hostname,$user,$pass); diff --git a/C4/Koha.pm b/C4/Koha.pm index c12f0d4d86..7a0db30f3f 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -13,33 +13,12 @@ $VERSION = 0.01; &fixEthnicity &borrowercategories ðnicitycategories - &configfile $DEBUG); use vars qw(); my $DEBUG = 0; -sub configfile { - my $configfile; - open (KC, "/etc/koha.conf"); - while () { - chomp; - (next) if (/^\s*#/); - if (/(.*)\s*=\s*(.*)/) { - my $variable=$1; - my $value=$2; - # Clean up white space at beginning and end - $variable=~s/^\s*//g; - $variable=~s/\s*$//g; - $value=~s/^\s*//g; - $value=~s/\s*$//g; - $configfile->{$variable}=$value; - } - } - return $configfile; -} - sub slashifyDate { # accepts a date of the form xx-xx-xx[xx] and returns it in the # form xx/xx/xx[xx] -- 2.39.5