Net
[ class tree: Net ] [ index: Net ] [ all elements ]

Class: Net_Ping

Source Location: /Net_Ping-2.4.5/Ping.php

Class Overview


Wrapper class for ping calls


Author(s):

Version:

  • $Revision: 274728 $

Methods


Inherited Variables

Inherited Methods


Class Details

[line 62]
Wrapper class for ping calls

Usage:

<?php require_once "Net/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')); } ?>

  • Author: Jan Lehnardt <jan@php.net>
  • Version: $Revision: 274728 $
  • Access: public


[ Top ]


Method Detail

checkHost   [line 417]

bool checkHost( string $host, [bool $severely = true])

Check if a host is up by pinging it
  • Return: True on success or false otherwise

Parameters:

string   $host   —  The host to test
bool   $severely   —  If some of the packages did reach the host and severely is false the function will return true

[ Top ]

factory   [line 137]

void factory( )

Factory for Net_Ping
  • Access: public

[ Top ]

ping   [line 373]

mixed ping( string $host)

Execute ping
  • Return: String on error or array with the result
  • Access: public

Parameters:

string   $host   —  hostname

[ Top ]

setArgs   [line 200]

mixed setArgs( array $args)

Set the arguments array
  • Return: true or PEAR_error
  • Access: public

Parameters:

array   $args   —  Hash with options

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:35:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.