定制 drewlabs/net 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

drewlabs/net

最新稳定版本:v0.2.2

Composer 安装命令:

composer require drewlabs/net

包简介

Networking utilities libraries

README 文档

README

This package provide developper with networking utilities.

Note: The package is under development and APIs are subject to changes.

Usage

Ping request

Ping clients provide developper with a unified interface for querying server existence using ping cli, php socket api or the generic PHP fsocketopen utility function. When using OS Ping binary to perform query, you are required to sanitize the data send through the comminication channel as these clients are often insecure for sensitve data. Prefer use of the Ping client as it's often fast that the php implementations. Default: Binary

// Import required classes & functions
use Drewlabs\Net\Client;
use Drewlabs\Net\Method;

// Create a PING client
$client = new Drewlabs\Net\Pring(<HOST>, [<PORT>, <TMIEOUT>]);
// example
$client = new Drewlabs\Net\Pring('https://liksoft.tg');

// Send request using default Channel
$response = $client->request(); // Returns \Drewlabs\Net\PingResult class
// Send a Ping request using PHP fsockopen util
$response = $client->request(Method::FSOCKOPEN);


// Get response details
$response->latency(); // Returns the latency of the PING request
$response->ip(); // Returns the IP address of the client

Extras

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固