From: Hadaq@styx Date: Thu, 10 Oct 2013 16:16:32 +0000 (+0200) Subject: changed get.pl to support httpi X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=522162260eb7dff98f051b2164c2e55e1420d0fc;p=daqtools.git changed get.pl to support httpi --- diff --git a/xml-db/get.pl b/xml-db/get.pl index 9bbf374..4530549 100755 --- a/xml-db/get.pl +++ b/xml-db/get.pl @@ -9,7 +9,6 @@ use Date::Format; use Pod::Usage; use Getopt::Long; use File::chdir; -use FindBin qw($RealBin); use Storable qw(lock_retrieve); use Text::TabularDisplay; use feature "switch"; @@ -22,17 +21,31 @@ my $isbrowser = 0; my ($file,$netaddr,$name, $style); $ENV{'DAQOPSERVER'}="localhost:7" unless (defined $ENV{'DAQOPSERVER'}); + + ############################### #### Check if browser or command line ############################### if(defined $ENV{'QUERY_STRING'}) { - $isbrowser = 1; - ($file,$netaddr,$name,$style) = split("-",$ENV{'QUERY_STRING'}); - $file = "$RealBin/cache/$file.entity"; - use CGI::Carp qw(fatalsToBrowser); - print "Content-type: text/html\n\n"; + if($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + $isbrowser = 1; + ($file,$netaddr,$name,$style) = split("-",$ENV{'QUERY_STRING'}); + $file = "htdocs/xml-db/cache/$file.entity"; + use CGI::Carp qw(fatalsToBrowser); + } + else { +# use FindBin qw($RealBin); + my $RealBin = "."; + $isbrowser = 1; + ($file,$netaddr,$name,$style) = split("-",$ENV{'QUERY_STRING'}); + $file = "$RealBin/cache/$file.entity"; + use CGI::Carp qw(fatalsToBrowser); + print "Content-type: text/html\n\n"; + } } else { +# use FindBin qw($RealBin); + my $RealBin = "."; Getopt::Long::Configure(qw(gnu_getopt)); GetOptions( 'help|h' => \$help,