xrobau/spfcheck 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

xrobau/spfcheck

Composer 安装命令:

composer require xrobau/spfcheck

包简介

Checks an IP address against a domain's SPF record

README 文档

README

Build Status Latest Stable Version Total Downloads License Coverage Status

Simple library to check an IP address against a domain's SPF record

This is an updated fork of mika56/spfcheck, with only minor changes.

Installation

This library is available through Composer. Run composer require xrobau/spfcheck or add this to your composer.json:

{
  "require": {
    "xrobau/spfcheck": "^1"
  }
}

Usage

Create a new instance of SPFCheck. The constructor requires a DNSRecordGetterInterface to be passed. Currently, you have two options:

  • DNSRecordGetter which uses PHP's DNS functions to get data
  • DNSRecordGetterDirect which uses the PHP DNS Direct Query Module to get data.
<?php
use Mika56\SPFCheck\SPFCheck;
use Mika56\SPFCheck\DNSRecordGetter;

require('vendor/autoload.php');

$checker = new SPFCheck(new DNSRecordGetter()); // Uses php's dns_get_record method for lookup.
var_dump($checker->isIPAllowed('127.0.0.1', 'test.com'));

// or

$checker = new SPFCheck(new DNSRecordGetterDirect("8.8.8.8")); // Uses phpdns, allowing you to set the nameserver you wish to use for the dns queries.
var_dump($checker->isIPAllowed('127.0.0.1', 'test.com'));

Return value is one of SPFCheck::RESULT_PASS, SPFCheck::RESULT_FAIL, SPFCheck::RESULT_SOFTFAIL, SPFCheck::RESULT_NEUTRAL, SPFCheck::RESULT_NONE, SPFCheck::RESULT_PERMERROR, SPFCheck::RESULT_TEMPERROR

Missing features

A few features are still missing from this library at the moment. Here's a partial list of those features:

You are very welcome to submit a pull request adding even part of those features.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固