Ajout debug

This commit is contained in:
Rodolphe Quiedeville 2005-11-21 16:36:34 +00:00
parent 8607afc479
commit 1db6868a07

View File

@ -51,7 +51,6 @@ else
exit(1); exit(1);
} }
GetPreselection_byRef($db, $host, $user_login, $user_passwd, $ids); GetPreselection_byRef($db, $host, $user_login, $user_passwd, $ids);
/* /*
@ -89,45 +88,50 @@ function GetPreselection_byRef($db, $host, $user_login, $user_passwd, $ids)
$out .= "Host: $host\r\n"; $out .= "Host: $host\r\n";
$out .= "Connection: Close\r\n\r\n"; $out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out); if (fwrite($fp, $out) )
while (!feof($fp))
{ {
$line = fgets($fp, 1024); while (!feof($fp))
if (preg_match("/<Preselection .* \/>/",$line))
{ {
$results = split(" ",trim($line)); $line = fgets($fp, 1024);
//print_r($results);
$array = array(); if (preg_match("/<Preselection .* \/>/",$line))
preg_match('/telnum="([0123456789]*)"/', $line, $array); {
$ligne_numero = $array[1]; $results = split(" ",trim($line));
//print_r($results);
$array = array(); $array = array();
preg_match('/Service_Statut="([\S]*)"/i', $line, $array); preg_match('/telnum="([0123456789]*)"/', $line, $array);
$ligne_service = $array[1]; $ligne_numero = $array[1];
$array = array(); $array = array();
preg_match('/PreSelection_Statut="([\S]*)"/i', $line, $array); preg_match('/Service_Statut="([\S]*)"/i', $line, $array);
$ligne_presel = $array[1]; $ligne_service = $array[1];
print "$i/$numcli "; $array = array();
print $ligne_numero." "; preg_match('/PreSelection_Statut="([\S]*)"/i', $line, $array);
print substr($ligne_service.str_repeat(" ",20),0,20); $ligne_presel = $array[1];
print substr($ligne_presel.str_repeat(" ",20),0,20);
print "\n"; print "$i/$numcli ";
} print $ligne_numero." ";
print substr($ligne_service.str_repeat(" ",20),0,20);
if (preg_match("/<Error .* \/>/",$line)) print substr($ligne_presel.str_repeat(" ",20),0,20);
{ print "\n";
$array = array(); }
preg_match('/libelle="(.*)" xmlns:d4p1/', $line, $array);
if (preg_match("/<Error .* \/>/",$line))
print "$i/$numcli "; {
print "$cli ErreurAPI ".$array[1]."\n"; $array = array();
preg_match('/libelle="(.*)" xmlns:d4p1/', $line, $array);
print "$i/$numcli ";
print "$cli ErreurAPI ".$array[1]."\n";
}
} }
} }
else
{
print "Impossible d'ecrire sur la socket";
}
fclose($fp); fclose($fp);
} }
} }