tomcan/public-suffix-list
Composer 安装命令:
composer require tomcan/public-suffix-list
包简介
A PHP consumable version of the DNS top level domains public suffix list from publicsuffix.org.
README 文档
README
A PHP consumable version of the DNS top level domains public suffix list from publicsuffix.org. It contains the actual list, and is updated periodically.
The library also includes a easy way to check for validity, or derive the TLD from a given domain name.
Installation
You can install the library through composer
composer require tomcan/public-suffix-list
The v1.5.x versions of the library support PHP 5.6 and above. This version is no longer maintained and may or may
not receive list updates, but no new features.
The v2.x.y versions of the library support PHP 7.4 and above.
Usage
There are 2 variants of the list. The PSLIcann class contains all 'official' TLDs as defined by ICANN.
The 'PSLFull' class also contains private TLDs that are children of the ICANN list, but also allow
registration by users, or even domains of large/popular services like AWS S3.
$psl = new PSLIcann();
// check if tld is valid
$valid = $psl->isTld('be'); // -> true
$valid = $psl->isTld('tom.be); // -> false
// get tld of given domain
$tld = $psl->getTldOfDomain('mt.tom.be'); // -> be
$tld = $psl->getTldOfDomain('oh.fc.it'); // -> fc.it
$psl = new PSLFull();
// check if tld is valid
$valid = $psl->isTld('s3.dualstack.ap-east-1.amazonaws.com'); // -> true
// get tld of given domain
$tld = $psl->getTldOfDomain('someappname.3.azurestaticapps.net'); // -> 3.azurestaticapps.net
// get type of given tld
$type = $psl->getType('be'); // -> icann
$type = $psl->getType('3.azurestaticapps.net'); // -> private
tomcan/public-suffix-list 适用场景与选型建议
tomcan/public-suffix-list 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 949 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 02 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tomcan/public-suffix-list 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tomcan/public-suffix-list 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 949
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-06