]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
changed get.pl to support httpi
authorHadaq@styx <hadaq@styx>
Thu, 10 Oct 2013 16:16:32 +0000 (18:16 +0200)
committerHadaq@styx <hadaq@styx>
Thu, 10 Oct 2013 16:16:32 +0000 (18:16 +0200)
xml-db/get.pl

index 9bbf374210aac7b8673419dd73003a189939894c..4530549d56737f1790a420b5ed4c70f966a61ebf 100755 (executable)
@@ -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,