cvsuser 02/04/13 20:50:40
Modified: P5EEx/Blue/cgi-bin p5x.PL
Log:
modified the way that the initialization config file and the default widget name are
determined from the PATH_INFO
Revision Changes Path
1.2 +21 -3 p5ee/P5EEx/Blue/cgi-bin/p5x.PL
Index: p5x.PL
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/cgi-bin/p5x.PL,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- p5x.PL 10 Mar 2002 17:26:02 -0000 1.1
+++ p5x.PL 14 Apr 2002 03:50:40 -0000 1.2
@@ -16,19 +16,34 @@
print OUT <<'!NO!SUBSTITUTIONS!';
#############################################################################
-# $Id: p5x.PL,v 1.1 2002/03/10 17:26:02 spadkins Exp $
+# $Id: p5x.PL,v 1.2 2002/04/14 03:50:40 spadkins Exp $
#############################################################################
BEGIN {
- my ($var, $value, $open, $file);
+ my ($var, $value, $open, $file, $tmp, $default_wname);
local(*FILE);
%main::conf = ();
$open = 0; # assume we cannot find an openable config file ...
- if (defined $ENV{PATH_INFO}) {
+ $default_wname = "";
+ if (defined $ENV{PATH_INFO} && $ENV{PATH_INFO} ne "/") {
$file = $ENV{PATH_INFO} . ".conf"; # default config file based on
PATH_INFO
$file =~ s!^/!!; # with no leading "/"
$file =~ s!/!_!g; # and internal "/"s changed to "_"s
$open = open(main::FILE, "< $file") if (-r $file);
+ while (!$open && $file =~ s/_([a-zA-Z0-9\.-]+)\.conf/.conf/) {
+ if ($default_wname) {
+ $default_wname = "$1_$default_wname";
+ }
+ else {
+ $default_wname = $1;
+ }
+ $open = open(main::FILE, "< $file") if (-r $file);
+ }
+ if (!$open) {
+ $default_wname = $ENV{PATH_INFO}; # default config default_wname based
on PATH_INFO
+ $default_wname =~ s!^/!!; # with no leading "/"
+ $default_wname =~ s!/!_!g; # and internal "/"s changed to "_"s
+ }
}
$open = open(main::FILE, "< $0.conf") if (!$open && -r "$0.conf");
$open = open(main::FILE, "< p5ee.conf") if (!$open && -r "p5ee.conf");
@@ -51,6 +66,9 @@
if (defined $main::conf{perlinc}) { # add perlinc entries
unshift(@INC, split(/ *, */,$main::conf{perlinc}));
}
+ }
+ if ($default_wname) {
+ $main::conf{defaultWname} = $default_wname;
}
}