承接 outsanity/ip-analysis 相关项目开发

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

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

outsanity/ip-analysis

Composer 安装命令:

composer require outsanity/ip-analysis

包简介

Library for analyzing IP addresses

README 文档

README

Analyzes IP addresses to help programmatically identify IPs that are globally reachable, or not, and find out additional details about the IP.

Installation

If you're using composer, run:

composer require outsanity/ip-analysis

Usage

<?php

require 'vendor/autoload.php';

use Outsanity\IpAnalysis\IpAnalysis;

$ip = new IpAnalysis('127.0.0.1');
echo 'documentation: ' . ($ip->isDocumentation()  ? 'yes' : 'no') . "\n"; // 192.0.2.65, 2001:db8:1:3::2
echo 'global: ' .        ($ip->isGlobal()         ? 'yes' : 'no') . "\n"; // 8.8.8.8, 2001:4860:4860::8888
echo 'loopback: ' .      ($ip->isLoopback()       ? 'yes' : 'no') . "\n"; // 127.0.0.1, ::1
echo 'multicast: ' .     ($ip->isMulticast()      ? 'yes' : 'no') . "\n"; // 224.0.1.1, ff00::101
echo 'private: ' .       ($ip->isPrivateNetwork() ? 'yes' : 'no') . "\n"; // 10.0.0.1, 192.168.0.1, fd11:1111:1111::1
echo 'subnet: ' .        ($ip->isLocalNetwork()   ? 'yes' : 'no') . "\n"; // 169.254.0.1, fe80::6450:6a14:93ba:de09

Expected output:

documentation: no
global: no
loopback: yes
multicast: no
private: no
subnet: no

Build Support

A second package, IP Analysis Helper, converts the IANA .csv rule file into SpecialAddressBlock entities. These live in Outsanity\IpAnalysis\SpecialAddressBlock\Factory::$allRaw.

Thanks

The rules come from the IANA IPv4 Special Address Registry and the IANA IPv6 Special Address Registry.

Additional help came from the Wikipedia Reserved IP Addresses page and the RIPE IPv6 Reference Card.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2020-02-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固