IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 30, 2010, 9:31:50 AM (16 years ago)
Author:
eugene
Message:

updates from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/ippMonitor/raw/getimage.php

    r28043 r28794  
    1111// global $PSCONFIG
    1212
     13
    1314### these need to be set to the correct locations!!
    1415$MISSING = "missing.png";
     
    2021}
    2122
    22 
    2323putenv("PSCONFDIR=$PSCONFDIR");
    2424putenv("PSCONFIG=$PSCONFIG");
     
    2828
    2929if ($debug) {
     30  echo "DEBUG1<br>";
    3031  echo "args: $args<br>";
    3132  echo "path: $PATH<br>";
    3233  echo "perl: $PERLLIB<br>";
    3334  echo "bindir: $BINDIR<br>";
     35  echo "site=$SITE<br>\n";
    3436}
    3537
    36 # $basename may contain filename@filerule
     38// $basename may contain filename@filerule
    3739$basename = $_GET[name];
     40if ($basename == "noimage.noimage") {
     41  $file = fopen ("noimage.png", "r");//$MISSING?
     42  if ($file && !$debug) {
     43    # do I need to use image/jpg? can I modify this to image/png, etc, based on the type?
     44           header ('Content-Type: image/jpg');
     45    fpassthru ($file);
     46  }
     47  exit ();
     48}
    3849$filerule = $_GET[rule];
    3950$camera   = $_GET[camera];
     
    4354
    4455if ($debug) {
     56  echo "DEBUG2<br>";
    4557  echo "basename: $basename<br>";
    4658  echo "filerule: $filerule<br>";
     
    6476
    6577if ($debug) {
    66   exec ("which ipp_filename.pl", $output, $status);
    67   echo "which ipp_filename.pl output:<br>";
     78  echo "DEBUG3<br>";
     79  $output = array();
     80  exec ("which $BINDIR/ipp_filename.pl", $output, $status);
     81  echo "which $BINDIR/ipp_filename.pl output:<br>";
    6882  for ($i = 0; $i < count($output); $i++) {
    6983    echo "output $i: $output[$i]<br>";
     
    7185  echo "status:   $status<br>";
    7286
     87  $output = array();
    7388  exec ("whoami", $output, $status);
    7489  echo "which whoami output:<br>";
     
    7994}
    8095
    81 exec ("ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id", $output, $status);
     96/* --site=$SITE */
     97$output = array();
     98exec ("ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id 2> /tmp/errors", $output, $status);
    8299
    83100# use these to check the environment
     
    91108
    92109if ($debug) {
     110  echo "DEBUG4<br>";
     111  echo "Command = ipp_filename.pl --site=$SITE --basename $basename --filerule $filerule --camera $camera --class_id $class_id<br>\n";
    93112  echo "basename: $basename<br>";
    94113  for ($i = 0; $i < count($output); $i++) {
    95114    echo "output $i: $output[$i]<br>";
    96115  }
    97   echo "output:   $output[0]<br>";
    98116  echo "status:   $status<br>";
    99117  echo "filename: $filename<br>";
Note: See TracChangeset for help on using the changeset viewer.