frdl/iana-enterprise-numbers-fetcher

从 IANA 获取 PEN 列表,并可选择在其中搜索。

v1.0.0 2023-01-28 00:45 UTC

This package is auto-updated.

Last update: 2024-09-28 05:04:46 UTC


README

从 IANA 获取 PEN 列表,并可选择在其中搜索。

示例

header('Content-Type: text/plain');
$Fetcher = new IanaPenListFetcher();
$result = $Fetcher();
 echo print_r(count($result), true). " Records found\n";
 
//This should search and find the SAME entry (by email, id, oid, name, org):
 echo print_r($Fetcher('till@webfan.de'), true). "\n";
 echo print_r($Fetcher(37553), true). "\n";
 echo print_r($Fetcher('1.3.6.1.4.1.37553'), true). "\n";
 echo print_r($Fetcher('Wehowski'), true). "\n";
 echo print_r($Fetcher('frdl'), true). "\n";

可选的自定义配置

$Fetcher->setRoot('1.3.6.1.4.1');
$Fetcher->setUrl('https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers');
$Fetcher->setCachelimit(60 * 60);
$Fetcher->setCachefile(__DIR__.\DIRECTORY_SEPARATOR.'penlist.php');