midweste/spf-lib-flattener
Composer 安装命令:
composer require midweste/spf-lib-flattener
包简介
A library to flatten SPF records
关键字:
README 文档
README
No tests yet - Use at your own risk!
Extension of the wonderful SPF-LIB library by mlocati (https://github.com/mlocati/spf-lib)
This PHP library allows you to:
- flatten a spf record into ips addresses
- split a flattened spf record into primary and child spf records
- get the SPF record from a domain name (parent lib mlocati/spf-lib)
- decode and validate the SPF record (parent lib mlocati/spf-lib)
- create the value of a TXT record (parent lib mlocati/spf-lib)
- check if domains and IP addresses satisfy the SPF records (parent lib mlocati/spf-lib)
- all the rest of what SPF-LIB library by mlocati (https://github.com/mlocati/spf-lib) can do
Short introduction about SPF Flattener/Splitter
This library is meant to address the issue where more than 10 lookups are present in a SPF record.
There are two parts:
- RecordFlattener - this class will flatten an spf record into an aggregated list of ips addresses
- RecordSplitter - takes a flattened record and split the ip addresses of into child records like spf1.domain.com spf2.domain.com
Because this is an extension to the wonderful SPF-LIB library by mlocati (https://github.com/mlocati/spf-lib), you can use this PHP library to build, validate, flatten, split, and check the SPF records.
Installation
You can install this library with Composer:
composer require midweste/spf-lib-flattener
Usage
Flattening an spf record from a domain name
namespace SpfLibFlattener; require __DIR__ . '/../vendor/autoload.php'; $domain = 'example.com'; $spf = new SpfFlattener($domain); $flatArray = $spf->toFlatArray(); $flatString = $spf->toFlatString(); $flatRecord = $spf->toFlatRecord();
Flattening an spf record from an existing string record
namespace SpfLibFlattener; require __DIR__ . '/../vendor/autoload.php'; $domain = 'example.com'; // Flatten a record by passing the record as a string $record = 'v=spf1 include:example.com include:google.com -all'; $spf = SpfFlattener::createFromText($domain, $record); $flatArray = $spf->toFlatArray(); $flatString = $spf->toFlatString(); $flatRecord = $spf->toFlatRecord();
Splitting an spf record from an existing string record
namespace SpfLibFlattener; require __DIR__ . '/../vendor/autoload.php'; $domain = 'example.com'; $spf = new SpfFlattener($domain); $splitter = RecordSplitter::createFromTxt($spf->toFlatString()); $split = $splitter->split(512, 'spf#.' . $domain); foreach ($split as $name => $r) { echo "name:$name record:$r<br/>" . PHP_EOL; }
Do you want to really say thank you?
You can offer the original author that did all the heavy lifting (mlocati) a monthly coffee or a one-time coffee 😉
midweste/spf-lib-flattener 适用场景与选型建议
midweste/spf-lib-flattener 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 12 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「dns」 「spf」 「flattener」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 midweste/spf-lib-flattener 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 midweste/spf-lib-flattener 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 midweste/spf-lib-flattener 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A php package to flatten nested json objects and nested arrays. It also allows you to create csv files from the flattened data.
WordPress mu-plugin to set sender/return path for mail if not set..
This authres_status plugin checks the Authentication-Results headers of your emails and displays the verification status. The verification status is displayed when you read an email, but you can also add a column to your message list.
A php package to flatten nested json objects and nested arrays. It also allows you to create csv files from the flattened data.
🔏 Stand-alone DKIM class to sign your emails with a 2048 bit private key hashed with SHA-256 algorithm.
An advanced PHP library for email validation with DNS checks and typo suggestions.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-27