Diff for /loncom/configuration/Configuration.pm between versions 1.11 and 1.13

version 1.11, 2003/07/22 19:21:10 version 1.13, 2006/09/15 20:49:27
Line 38  $VERSION = sprintf("%d.%02d", q$Revision Line 38  $VERSION = sprintf("%d.%02d", q$Revision
   
 use strict;  use strict;
   
 my $confdir='/etc/httpd/conf/';  my @confdirs=('/etc/httpd/conf/','/etc/apache2/');
   
 # ------------------- Subroutine read_conf: read LON-CAPA server configuration.  # ------------------- Subroutine read_conf: read LON-CAPA server configuration.
 # This subroutine reads PerlSetVar values out of specified web server  # This subroutine reads PerlSetVar values out of specified web server
 # configuration files.  # configuration files.
 sub read_conf  sub read_conf {
   {  
     my (@conf_files)=@_;      my (@conf_files)=@_;
     my %perlvar;      my (%perlvar,%configdirs);
     foreach my $filename (@conf_files,'loncapa_apache.conf')      foreach my $filename (@conf_files,'loncapa_apache.conf') {
       {          my $configdir = '';
  open(CONFIG,'<'.$confdir.$filename) or          $configdirs{$filename} = [@confdirs];
     die("Can't read $confdir$filename");          while ($configdir eq '' && @{$configdirs{$filename}} > 0) {
  while (my $configline=<CONFIG>)              my $testdir = shift(@{$configdirs{$filename}});
   {              if (-e $testdir.$filename) {
     if ($configline =~ /^[^\#]*PerlSetVar/)                  $configdir = $testdir;
       {              }
           }
           if ($configdir eq '') {
               die("Couldn't find a directory containing $filename");
           }
    open(CONFIG,'<'.$configdir.$filename) or
       die("Can't read $configdir$filename");
    while (my $configline=<CONFIG>) {
       if ($configline =~ /^[^\#]*PerlSetVar/) {
  my ($unused,$varname,$varvalue)=split(/\s+/,$configline);   my ($unused,$varname,$varvalue)=split(/\s+/,$configline);
  chomp($varvalue);   chomp($varvalue);
  $perlvar{$varname}=$varvalue;   $perlvar{$varname}=$varvalue;
       }      }
   }   }
  close(CONFIG);   close(CONFIG);
       }      }
     my $perlvarref=\%perlvar;      my $perlvarref=\%perlvar;
     return ($perlvarref);      return ($perlvarref);
   }  }
   
 #---------------------- Subroutine read_hosts: Read a LON-CAPA hosts.tab  #---------------------- Subroutine read_hosts: Read a LON-CAPA hosts.tab
 # formatted configuration file.  # formatted configuration file.

Removed from v.1.11  
changed lines
  Added in v.1.13


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>