System information
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 24
Called from ppp_offline(). Sends SIGUSR2 (12) to the currently running ppp-
wrapper.
If the wrapper isn't running, the function returns –1 and an error is logged in the syslog.
function ppp_online($behavior, $max_attempt, $ppp_interval)
{
...
}
Initializes the ppp connection.
Returns 1 if the connection is established, -1 for errors and logs the error in the syslog.
$behavior describes the ppp connection’s behavior when closing the connection, and
can be either CloseAfter or Optimized.
$max_attempt is the number of attempts to connect before failing.
$ppp_interval is the delay in seconds between connection attempts.
function ppp_offline($behavior, $sec)
{
...
}
Closes the ppp connection
$behavior describes the ppp connection’s behavior and can be either CloseAfter or
Optimized.
$sec is the time in seconds to wait before calling ppp_stop() if
$behaviour="CloseAfter”. If $behaviour="Optimized" there will be no wait,
ppp_stop is called immediately.
4.1.6 Examples
The first example shows how to use the FTP-function together with the bufferd example:
<?php
include "/usr/php/ftp.lib";
include "/usr/php/log.lib";
$host="host.domain";
$user="user";
$pass="password";
$time="0";
$delay="0";
$source="/tmp/SNAP/snapshot.jpg";
$destination="snapshot.jpg";
$suffix="date";
$countermax="";
$startcount="";
$port="21";