Axis 2401 - PHP3 GUIDE Informacje Techniczne Strona 34

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
Przeglądanie stron 33
An Introduction to PHP3
Axis Communications AB provides NO 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 1.02 October 2002 34
The script itself follows:
error_reporting(E_ALL);
function conv($value)
{ // A function for converting
//single digit integers into
//two digit integers
if($value < 10) {
$value = "0$value";
}
return strval($value);
}
for($c=0;$c<(strlen($sources));$c++)
{ // Start the buffers as
//specified by the parameters
//above
//$command="bufferd -reset -buffername
//".$buffer_prefix.substr($sources,$c,1);
//system($command);
$command="bufferd -start -buffername ";
$command.=$buffer_prefix.substr($sources,$c,1);
$command.=" -snapshot -pre 1 -predelay ";
$command.=strval($delay);
$command.=" -uri ftp://jpg/";
$command.=substr($sources,$c,1);
$command.="/";
$command.=$image_format;
$command.=".jpg -format ";
$command.=$file_format;
system($command);
}
error_reporting(0);
$current_counter = 1;
if($fd = fopen("/tmp/counter","r"))
{ // If the file looked for
//exists, retrieve the index to
//start at
while($buf = fread($fd,8))
{
$current_counter .= $buf;
}
$current_counter = intval($current_counter);
fclose($fd);
}
//the specified maximum, reset
//index
$current_counter = 1;
if($fd = fopen("/tmp/counter","w"))
{
$buf = fwrite($fd,strval($current_counter));
fclose($fd);
}
}
error_reporting(E_ALL);
if(($suffix=="sequence") && $current_counter > $counter_max)
{ // If the loaded index exceeds
Przeglądanie stron 33
1 2 ... 29 30 31 32 33 34 35 36 37 38 39 ... 84 85

Komentarze do niniejszej Instrukcji

Brak uwag