2017 © Pedro Peláez
 

library regdom

OO adaptation of Florian Sager's regdom library for querying Mozilla Public Suffix List

image

geekwright/regdom

OO adaptation of Florian Sager's regdom library for querying Mozilla Public Suffix List

  • Wednesday, February 7, 2018
  • by geekwright
  • Repository
  • 1 Watchers
  • 0 Stars
  • 489 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 6 % Grown

The README.md

RegDom - Registered Domain Check in PHP

Object oriented adaptation of Florian Sager's regdom library for querying Mozilla's Public Suffix List, complete with unit testing., (*1)

For more information of public suffixes, and why you may want to query the list, please see publicsuffix.org, (*2)

Installation

composer require xoops/regdom, (*3)

Usage

Class Xoops\RegDom\PublicSuffixList

This 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., (*4)

$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, (*5)

$psl->setURL($url)

Resets the current PSL, and uses the specified URL as the source., (*6)

$psl->getTree()

Returns the tree of the current PSL. Xoops\RegDom\RegisteredDomain uses this tree form for all lookups., (*7)

$psl->clearDataDirectory($cacheOnly)

By default, this will clear all cached PSL data, including local copies of remotely accessed PSL data. Pass true for $cacheOnly to clear only the serialized tree data., (*8)

Class Xoops\RegDom\RegisteredDomain

This class can be used to determine the registrable domain portion of a URL, respecting the public suffix list conventions., (*9)

$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., (*10)

$regdom->getRegisteredDomain($host)

Returns the shortest registrable domain portion of the supplied $host, or null if the host could not be validly registered., (*11)

Examples: echo $regdom->getRegisteredDomain('https://www.google.com/'); Outputs:, (*12)

google.com, (*13)

echo $regdom->getRegisteredDomain('theregister.co.uk'); Outputs:, (*14)

theregister.co.uk, (*15)

echo null === $regdom->getRegisteredDomain('co.uk'); Outputs:, (*16)

1, (*17)

script bin\reloadpsl

This script can be used to load a fresh copy of the PSL. It may be useful in cron job, or other scripted updates., (*18)

Credits

Reg-dom was written by Florian Sager, 2009-02-05, sager@agitos.de, (*19)

Original code was published at http://www.dkim-reputation.org/regdom-lib-downloads/, (*20)

Marcus Bointon's adapted code is here http://github.com/Synchro, (*21)

Original License

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

The Versions

07/02 2018

dev-master

9999999-dev https://github.com/geekwright/RegDom

OO adaptation of Florian Sager's regdom library for querying Mozilla Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Richard Griffith

tld suffix public regdom

03/10 2017

v1.0.5

1.0.5.0 https://github.com/geekwright/RegDom

OO adaptation of Florian Sager's regdom library for querying Mozilla Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Richard Griffith

tld suffix public regdom

03/03 2017

v1.0.4

1.0.4.0 https://github.com/geekwright/RegDom

OO adaptation of Florian Sager's regdom library for querying Mozilla Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

by Richard Griffith

tld suffix public regdom

15/02 2017

v1.0.3

1.0.3.0 https://github.com/geekwright/RegDom

OO adaptation of Florian Sager's regdom library for querying Mozilla Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

by Richard Griffith

tld suffix public regdom

08/02 2017

v1.0.2

1.0.2.0 https://github.com/geekwright/RegDom

OO adaptation of Florian Sager's regdom library for querying Mozilla Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

by Richard Griffith

tld suffix public regdom

07/02 2017

v1.0.1

1.0.1.0 https://github.com/geekwright/RegDom

OO adaptation of Florian Sager's regdom library for querying Mozilla Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

by Richard Griffith

tld suffix public regdom

07/02 2017

v0.1.0

0.1.0.0 https://github.com/geekwright/RegDom

OO adaptation of Florian Sager's regdom library for querying Mozilla Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

by Richard Griffith

tld suffix public regdom

07/02 2017

v1.0.0

1.0.0.0 https://github.com/geekwright/RegDom

OO adaptation of Florian Sager's regdom library for querying Mozilla Public Suffix List

  Sources   Download

Apache-2.0

The Requires

 

by Richard Griffith

tld suffix public regdom