Recommend this page to a friend! |
Classes of Michael Beck | Xoops 2.5 | htdocs/class/libraries/vendor/geekwright/regdom/README.md | Download |
|
![]() RegDom - Registered Domain Check in PHPObject oriented adaptation of Florian Sager's regdom library for querying Mozilla's Public Suffix List, complete with unit testing. For more information of public suffixes, and why you may want to query the list, please see publicsuffix.org Installation> composer require geekwright/regdom UsageClass Geekwright\RegDom\PublicSuffixListThis class handles all direct interaction with the public suffix list (PSL.) This includes, fetching the list from a source URL, caching that list locally, converting that list to a tree form to facilitate rapid lookup, and caching that tree in a serialized form. $psl = new PublicSuffixList($url)Creates a new PublicSuffixList object that will use the specified URL as the source of the PSL. If no $url is specified, it will default to https://publicsuffix.org/list/public_suffix_list.dat $psl->setURL($url)Resets the current PSL, and uses the specified URL as the source. $psl->getTree()Returns the tree of the current PSL. $psl->clearDataDirectory($cacheOnly)By default, this will clear all cached PSL data, including local copies
of remotely accessed PSL data. Pass true for Class Geekwright\RegDom\RegisteredDomainThis class can be used to determine the registrable domain portion of a URL, respecting the public suffix list conventions. $regdom = new RegisteredDomain(PublicSuffixList $psl)Creates a new RegisteredDomain object that will use $psl to access the PSL. If no $psl is specified, a new PublicSuffixList object will be instantiated using default behaviors. $regdom->getRegisteredDomain($host)Returns the shortest registrable domain portion of the supplied $host, or null if the host could not be validly registered. Examples:
script bin\reloadpslThis script can be used to load a fresh copy of the PSL. It may be useful in cron job, or other scripted updates. CreditsReg-dom was written by Florian Sager, 2009-02-05, sager@agitos.de Original code was published at http://www.dkim-reputation.org/regdom-lib-downloads/ Marcus Bointon's adapted code is here http://github.com/Synchro Original License
|