Re: cannot use Net_Ping 2.4
| From: | Stefan Neufeind | Date: | Tue, 09 Mar 2004 11:48:48 +0000 |
| Subject: | Re: cannot use Net_Ping 2.4 | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11180@lists.php.net to get a copy of this message | ||
Inside the package itself you find a small example. Okay, according
to the current rules this should be moved into a separate file under
docs/examples ... but for Net_Ping that has still got historical
reasons.
You have to use the factory-method. Here's the example.
<?php
require_once "Net_Ping/Ping.php";
$ping = Net_Ping::factory();
if(PEAR::isError($ping)) {
echo $ping->getMessage();
} else {
$ping->setArgs(array('count' => 2));
var_dump($ping->ping('example.com'));
}
?>
Good luck,
Stefan
On 8 Mar 2004 at 16:34, Felipe Ceglia wrote:
> I am trying to use Net_Ping, but I am running into some problems. I am
> not sure I am calling it in the right way.