2017 © Pedro Peláez
 

library mylittleping

Advanced ping library for PHP

image

luklewluk/mylittleping

Advanced ping library for PHP

  • Friday, October 7, 2016
  • by luklew
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

MyLittlePing

Object oriented and full configurable implementation of ICMP echo request message., (*1)

Installation

composer require luklewluk/mylittleping, (*2)

Basic usage

Using dependency injection:, (*3)

// Create object instances
$config = new Config();
$connection = new Socket($config);
$ping = new Ping($connection, $config);
// Send request
echo $ping->send('google.com') . PHP_EOL;

Using static factory:, (*4)

$ping = Ping::createWithConnection(Socket::class);
echo $ping->send('google.com') . PHP_EOL;

Connection implementations

Socket

The most advanced and customisable connection method., (*5)

Requires root access., (*6)

$connection = new Socket($config);

Fsockopen

It is not recommended way to get exact latency time. Also it can return response time even if server is not responding., (*7)

The method does not support custom parameters., (*8)

$connection = new Fsockopen($config);

Your own implementation

If you need to use your own connection method (i.e. "exec" way) you can easily do it by writing a new class which implements ConnectionInterface., (*9)

$ping = new Ping(new YourClass(), $config);

Custom parameters

List of available parameters to set:, (*10)

Port

$config->setPort(8080);

Payload

$config->setPayload('abcdefg');

The Versions

07/10 2016

dev-master

9999999-dev https://github.com/luklewluk/MyLittlePing

Advanced ping library for PHP

  Sources   Download

MIT

by Lukasz Lewandowski

library request client response ping delay host latency

07/10 2016

1.0.0

1.0.0.0 https://github.com/luklewluk/MyLittlePing

Advanced ping library for PHP

  Sources   Download

MIT

by Lukasz Lewandowski

library request client response ping delay host latency