承接 luklewluk/mylittleping 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

luklewluk/mylittleping

Composer 安装命令:

composer require luklewluk/mylittleping

包简介

Advanced ping library for PHP

README 文档

README

Object oriented and full configurable implementation of ICMP echo request message.

Installation

composer require luklewluk/mylittleping

Basic usage

Using dependency injection:

// 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:

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

Connection implementations

Socket

The most advanced and customisable connection method.

Requires root access.

$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.

The method does not support custom parameters.

$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.

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

Custom parameters

List of available parameters to set:

Port

$config->setPort(8080);

Payload

$config->setPayload('abcdefg');

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固