定制 diegonz/php-wake-on-lan 二次开发

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

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

diegonz/php-wake-on-lan

最新稳定版本:v2.1.1

Composer 安装命令:

composer require diegonz/php-wake-on-lan

包简介

Wake on lan target enabled devices by sending magic packets to them from PHP

README 文档

README

Travis Build Status StyleCI Status Codecov Status Latest Version on Packagist

Wake on lan target enabled devices by sending magic packets to them from PHP.

Installation

Require the package using composer:

composer require diegonz/php-wake-on-lan

Usage:

Normal PHP usage:

<?php

use \Diegonz\PHPWakeOnLan\PHPWakeOnLan;

$macAddresses = [
    '00:1B:2C:1C:DF:22',
    '01:1C:2C:1C:DF:13',
];

try {
    $wol = new PHPWakeOnLan();
    print_r($wol->wake($macAddresses));
} catch (Exception $e) {
    var_dump($e->getMessage());
}

Laravel facade usage:

<?php

use \Diegonz\PHPWakeOnLan\Facades\PHPWakeOnLan;

$macAddresses = [
    '00:1B:2C:1C:DF:22',
    '01:1C:2C:1C:DF:13',
];

try {
    print_r(PHPWakeOnLan::wake($macAddresses));
} catch (Exception $e) {
    var_dump($e->getMessage());
}

Example output:

Array
(
    [00:1B:2C:1C:DF:22] => Array
        (
            [result]     => OK
            [message]    => Magic packet sent to 00:1B:2C:1C:DF:22 through 255.255.255.255
            [bytes_sent] => 102
        )

    [01:1C:2C:1C:DF:13] => Array
        (
            [result]     => OK
            [message]    => Magic packet sent to 01:1C:2C:1C:DF:13 through 255.255.255.255
            [bytes_sent] => 102
        )
)

Laravel package config

You can publish laravel package configuration file running the command below:

php artisan vendor:publish --provider="Diegonz\PHPWakeOnLan\PHPWakeOnLanServiceProvider" --tag="config"

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

External links

Magic Packet Technology -

White paper describing the specification and implementation of Magic Packet™ technology from AMD, one of its two co-developers.

Credits

License

The MIT License (MIT). Please see license file for more information.

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-28