php-extended/php-suffix-list-bundle

该包已被废弃且不再维护。作者建议使用 php-extended/php-tld-provider-mozilla 包。

一个用于安全验证顶级域名的库


README

一个用于安全验证顶级域名的库。

此库使用 https://publicsuffix.org/list/public_suffix_list.dat 源文件来更新其内容。此库每周日更新一次。

最后更新日期:2020-09-13

安装

此库的安装通过 composer 完成。从 其网站 下载 composer.phar。然后在您的 composer.json 中添加以下内容

	"require": {
		...
		"php-extended/php-suffix-list-bundle": "^2",
		...
	}

然后运行 php composer.phar update 以安装此库。此库所有类的自动加载都通过 composer 的自动加载器完成。

基本用法

您可以使用以下方式使用此库


use PhpExtended\SuffixList\PublicSuffixListBundle;

$domain = '<put the domain you want to check there>';

$isTLD = PublicSuffixListBundle::isInTheList($domain);
// true if the domain is in the list, false otherwise

许可协议

MIT (见 许可文件).