Easy Ping Helper for PHP

v1.0.1 2017-08-17 08:55 UTC

README

Build Status PHP from Packagist Latest Version License

Composer

Require this package, with Composer, in the root directory of your project.

$ composer require faustbrian/ping

Usage

<?php

$ping = new BrianFaust\Ping\Ping();
$latency = $ping
    ->host("127.0.0.1")
    ->port(80)
    ->driver('tcp')
    ->ping();

if ($latency) {
    dd("Latency is {$latency}ms");
} else {
    dd("Host [{$host}] seems to be down.");
}

Testing

$ phpunit

Security

If you discover a security vulnerability within this package, please send an e-mail to hello@brianfaust.me. All security vulnerabilities will be promptly addressed.

Credits

License

MIT © Brian Faust