定制 kelixlabs/kelix-net-tools 二次开发

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

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

kelixlabs/kelix-net-tools

Composer 安装命令:

composer require kelixlabs/kelix-net-tools

包简介

Network Utility package for Laravel 5

README 文档

README

Packagist Software License Total Downloads

PHP Library for Networking Tools (IPv4 and IPv6) Use for Laravel 5

Install

Via Composer

$ composer require kelixlabs/kelix-net-tools:dev-master

Via edit composer.json

"require": {
	"kelixlabs/kelix-net-tools": "dev-master"
}

Next, update Composer from the Terminal:

$ composer update

Add to laravel config

Once this operation completes, the final step is to add the service provider. Open config/app.php, and add a new item to the providers array.

'aliases' => array(
    .....
    kelixlabs\KelixNetTools\kelixNetToolsServiceProvider::class,
);

Now add the alias.

'aliases' => array(
    ......
    'NetTools' => kelixlabs\KelixNetTools\Facade\NetTools::class,
);

Usage

// Generate network object
$network = new NetTools;
// The default IP set to 127.0.0.1 and Netmask 255.255.255.0

// Set the IP and Netmask
$network::setIP('10.3.30.179');
$network::setNetmask('255.255.255.0');

// Get the IP and Netmask
$ip = $network::getIP();
$netmask = $network::getNetmask();

// Get Ping latency from current IP set
$latency = $network::ping()->ping();

// Get Ping latency from given ip
$latency = $network::ping('192.168.1.123')->ping();

// Get Network info from current IP set
$network = $network::network()->info;

// Get Network info from given IP and Netmask
$network = $network::network('192.168.1.123','255.255.255.0')->info;

// Get individual Network info
$CIDR = Network::network()->CIDR;
$broadcast = (string)Network::network()->broadcast;

// Get MAC address from target's IP
$mac = $network::network()->mac;

// Bonus Wake On Lan
// NetTools::WakeOnLan('Mac Address','Broadcast Address')->WakeUp();
$wakeOnLan = $network::WakeOnLan('74-27-ea-5e-74-59','10.3.30.255')->WakeUp();

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固