Appendix C - PHP3 Script Examples
while($file_name = readdir($buffer_handle))
{
}
closedir($buffer_handle);
}
}
else
{
error_log("Could not upload alarmbuffer. Session closed",0);
}
error_log("Restarting buffer(s)",0);
for($c=0;$c<(strlen($alarm_sources));$c++)
{
$command="bufferd -reset -buffername
".$alarm_buffer_prefix.substr($alarm_sources,$c,1);
system($command);
$command="bufferd -start -buffername
".$alarm_buffer_prefix.substr($alarm_sources,$c,1)." -pre
".strval($pre)." -post ".strval($post)." -predelay
".strval($predelay)." -postdelay ".strval($postdelay)." -uri
ftp://jpg/".substr($alarm_sources,$c,1)."/".$alarm_image_format.
".jpg";
system($command);
}
//function handle_alarm()
}
function conv($value)
{
Axis Communications AB does not provide support for application development of any kind. The
information here is provided "as is", and there is no guarantee that any of the examples shown
will work in your particular application.
Revision 0.9 May 2001
if(($file_name != ".") &&($file_name != ".."))
{
$file =
"/tmp/".$alarm_buffer_prefix.substr($alarm_sou
rces,$i,1)."/".$file_name;
$destination_name =
$alarm_destination.$alarm_buffer_prefix.substr
($alarm_sources,$i,1);
$destination_name .= strchr($file_name,"_");
if(!ftp_put($session, $destination_name,
$file, FTP_BINARY))
{
error_log("Could not upload file
".$file." as
".$destination_name."\n",0);
}
unlink($file);
}
// And for each regular
//file in that directory
// Upload file
// Reset and restart
//buffers
// A function for
//converting single digit
61
Need help?
Do you have a question about the 2400 - PHP3 GUIDE and is the answer not in the manual?
Questions and answers