定制 phergie/phergie-irc-plugin-dns 二次开发

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

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

phergie/phergie-irc-plugin-dns

最新稳定版本:4.0.0

Composer 安装命令:

composer require phergie/phergie-irc-plugin-dns

包简介

Phergie plugin for Looking up IP's by hostnames

README 文档

README

Phergie plugin for Looking up IP's by hostnames.

Build Status

Install

To install via Composer, use the command below, it will automatically detect the latest version and bind it with ~.

composer require phergie/phergie-irc-plugin-dns 

See Phergie documentation for more information on installing and enabling plugins.

Configuration

new \Phergie\Plugin\Dns\Plugin([

    // All configuration is optional

    'dnsServer' => '1.2.3.4', // IP address of a DNS server, defaults to Google's 8.8.8.8

    // or

    'command' => 'customDns', // command name, defaults to dns

    // or

    'resolver' => new React\Dns\Resolver\Resolver(), // provide your own Resolver instance
                                                     // defaults to null and is set at first use
                                                     // (don't use this unless you know what you are doing!)

    // or

    'enableCommand' => false,  // enable use access to the dns command
])

Events

This plugin listens on a few events providing the resolver to other plugins that wish to make use of it.

dns.resolve

The dns.resolve event accepts a callback that will be called with a Promise that will resolve once the given hostname has been resolved. (If promises are new to you, be sure to read this.)

$this->emitter->emit('dns.resolve', [function($promise) use ($callback, $that) {
    $promise->then(function($ip) {
        echo 'IP for github.com: ' . $ip . PHP_EOL;
    });
}]);

dns.resolver

The dns.resolver event accepts a callback that will be called once a Resolver instance has been created.

$this->emitter->emit('dns.resolver', [function($resolver) use ($callback, $that) {
    $resolver->resolve('github.com')->then(function($ip) {
        echo 'IP for github.com: ' . $ip . PHP_EOL;
    });
}]);

Tests

To run the unit test suite:

curl -s https://getcomposer.org/installer | php
php composer.phar install
cd tests
../vendor/bin/phpunit

License

Released under the MIT License. See LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固