[LON-CAPA-cvs] cvs: loncom /configuration Configuration.pm
harris41
lon-capa-cvs@mail.lon-capa.org
Mon, 09 Sep 2002 13:57:37 -0000
harris41 Mon Sep 9 09:57:37 2002 EDT
Modified files:
/loncom/configuration Configuration.pm
Log:
fixing documentation and general beautification
Index: loncom/configuration/Configuration.pm
diff -u loncom/configuration/Configuration.pm:1.6 loncom/configuration/Configuration.pm:1.7
--- loncom/configuration/Configuration.pm:1.6 Fri May 17 10:03:04 2002
+++ loncom/configuration/Configuration.pm Mon Sep 9 09:57:37 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Configuration file reader
#
-# $Id: Configuration.pm,v 1.6 2002/05/17 14:03:04 matthew Exp $
+# $Id: Configuration.pm,v 1.7 2002/09/09 13:57:37 harris41 Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -31,32 +31,41 @@
#
###
+# POD documentation is at the end of this short module.
+
package LONCAPA::Configuration;
-$VERSION = sprintf("%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/);
use strict;
my $confdir='/etc/httpd/conf/';
-# ------------------------------------ read_conf: read LON-CAPA server configuration, especially PerlSetVar values
-sub read_conf {
+# ------------------- Subroutine read_conf: read LON-CAPA server configuration.
+# This subroutine reads PerlSetVar values out of specified web server
+# configuration files.
+sub read_conf
+ {
my (@conf_files)=@_;
my %perlvar;
- foreach my $filename (@conf_files,'loncapa_apache.conf') {
- open(CONFIG,'<'.$confdir.$filename) or die("Can't read $confdir$filename");
- while (my $configline=<CONFIG>) {
- if ($configline =~ /^[^\#]*PerlSetVar/) {
+ foreach my $filename (@conf_files,'loncapa_apache.conf')
+ {
+ open(CONFIG,'<'.$confdir.$filename) or
+ die("Can't read $confdir$filename");
+ while (my $configline=<CONFIG>)
+ {
+ if ($configline =~ /^[^\#]*PerlSetVar/)
+ {
my ($unused,$varname,$varvalue)=split(/\s+/,$configline);
chomp($varvalue);
$perlvar{$varname}=$varvalue;
- }
- }
+ }
+ }
close(CONFIG);
- }
+ }
my $perlvarref=\%perlvar;
return ($perlvarref);
-}
+ }
__END__
@@ -71,7 +80,7 @@
use lib '/home/httpd/lib/perl/';
use LONCAPA::Configuration;
- LONCAPA::Configuration::read_conf('loncapa_apache.conf','loncapa.conf');
+ LONCAPA::Configuration::read_conf('loncapa.conf');
=head1 DESCRIPTION