From 1c9ef0371f7cb1b3ac642d47a554fe0b0897fb56 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Fri, 5 Jan 2001 16:30:45 +0000 Subject: [PATCH] Added support for moving path=... variable to /etc/koha.conf --- C4/Output.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/C4/Output.pm b/C4/Output.pm index 46010ae0f4..7b06a178f7 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -43,7 +43,24 @@ my @more = (); # # Change this value to reflect where you will store your includes # -my $path="/usr/local/www/hdl/htdocs/includes"; +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; + } +} +my $path=$configfile{'path'}; +($path) || ($path="/usr/local/www/hdl/htdocs/includes"); # here's a file-private function as a closure, -- 2.39.2