jeremykendall/php-domain-parser
Public Suffix List and IANA Root Zone Database based Domain parsing implemented in PHP.
6.4.0
15M downloads/mo
#1093 most downloaded on Packagist
jeremykendall/php-domain-parser
What this package is like to depend on
Last release 1 years ago
26 Apr 2025
Release timing varies
gaps range from 3 weeks to 1.7 years
Some releases are documented
notes for 18 of 44 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
48 releases · first in 2013
0 releases in the last 12 months
see the full history below
Release timeline
48 releases · Jan 2013 to Apr 2025Releases
latest 48-
6.4.026 Apr 2025Release notes
Open source →Added
DomainName::withRootLabel,DomainName::withoutRootLabel,DomainName::isAbsolutemethods to handle absolute domain names.DomainName::whento allow conditionable when building the domain.
Fixed
- Absolute domain name can now also be resolved by the package see issue #361 prior to this release an exception was thrown.
- Since we no longer support PHP7 type hint and return type are improved.
- Resolving private suffixes that have a wildcarded subdomain suffix #363 by @wikando-ck
Warning
When upgrading to version
6.4you MUST refresh your local cache for the fix on private domain resolution to take effect.Deprecated
- None
Removed
- None
Release notes
Open source →Added
DomainName::withRootLabel,DomainName::withoutRootLabel,DomainName::isAbsolutemethods to handle absolute domain names.DomainName::whento allow conditionable when building the domain.
Fixed
- Absolute domain name can now also be resolved by the package see issue #361 prior to this release an exception was thrown.
- Since we no longer support PHP7 type hint and return type are improved.
- Resolving private suffixes that have a wildcarded subdomain suffix #363 by @wikando-ck (Once downloaded and installed you MUST refresh your cache to enable the fix to work.)
Deprecated
- None
Removed
- None
-
6.3.110 Nov 2024 -
6.3.025 Feb 2023Release notes
Open source →Added
RegisteredNameclass to allow domain with IP4-like labels
Fixed
- Using PHPUnit 10
Domaindecorates the newRegisteredNameclass #347Host::withoutLabelworks without arguments.
Deprecated
- None
Removed
- None
Release notes
Open source →Added
RegisteredNameclass to allow domain with IP4-like labels
Fixed
- Using PHPUnit 10
Domaindecorates the newRegisteredNameclass #347Host::withoutLabelworks without arguments.
Deprecated
- None
Removed
- None
-
6.2.005 Nov 2022Release notes
Open source →Added
- None
Fixed
-
Internal code to make services
readonly -
Internal code to make VO properties
readonly -
Internal code improved typehinting
-
Deprecated
-
None
Removed
- PHP7 and PHP8.0 support
-
6.1.229 Sep 2022Release notes
Open source →Added
- None
Fixed
- #321 remove regression when resolving private domain suffix.
Deprecated
- None
Removed
- None
Release notes
Open source →Added
- None
Fixed
- #321 remove regression to resolving private domain suffix.
Deprecated
- None
Removed
- None
-
6.1.118 Feb 2022Release notes
Open source →Added
- None
Fixed
- #321 improve resolving private domain suffix.
Rules::getPrivateDomainis more restrictive It will throw if the domain name does not contain a valid "private" TLD.
Deprecated
- None
Removed
- None
Release notes
Open source →Added
- None
Fixed
- #321 improve resolving private domain suffix.
Rules::getPrivateDomainwill now throw if the domain name does not contain a "private" TLD.
Deprecated
- None
Removed
- None
-
6.1.019 Jun 2021Release notes
Open source →Added
TimeToLive::untilTimeToLive::fromDurationString
Fixed
.gitattributesfiles to be filter out.TimeToLivemarked as internalHost::toUnicodemethod MUST never throw exceptions on conversion according to RFC3490.UnableToResolveDomaintypo in the exception message
Deprecated
TimeToLive::fromDateTimeInterfaceuseTimeToLive::fromNowTimeToLive::fromScalaruseTimeToLive::convert
Removed
- None
Release notes
Open source →Added
TimeToLive::untilTimeToLive::fromDurationString
Fixed
.gitattributesfiles to be filter out.TimeToLivemarked as internalHost::toUnicodemethod MUST never throw exceptions on conversion according to RFC3490.UnableToResolveDomaintypo in the exception message
Deprecated
TimeToLive::fromDateTimeInterfaceuseTimeToLive::fromNowTimeToLive::fromScalaruseTimeToLive::convert
Removed
- None
-
6.0.013 Dec 2020Release notes
Open source →Added
- Adding proper Interfaces
- Added
Domain::clearto easily initialize an empty domain object - Added
Domain::sliceto easily slice a domain object - Added
ResolvedDomainobject to normalize Resolver results. - Added
Suffixobject to replace thePublicSuffixobject from v5. - Public Suffix List and IANA Top Level Domain List are fully decoupled
- Added
Idna, IDN support has been completely revamped - Added internal
Streamclass, to improve path/stream resolution - Resolver uses by default UTS#46 IDNA2008 algorithm to convert domain names
- Storage capability is now optional and can be based on PHP-FIG related interfaces to improve interoperability
Pdp\TopLevelDomains::getIANADomainwhich throws on syntax error and if no effective TLD is found (behave likePdp\TopLevelDomains::resolvein v5).
Fixed
- The
Pdp\Domainclass not longer directly exposes Effective TLD status. - Effective TLD resolver (
Pdp\Rules::resolveandPdp\TopLevelDomains::resolve) no longer accept IDNA options. Rules::getICANNDomain,Rules::getPrivateDomainwill throw even if aPublicSuffixis found but does not belong to the correct PSL section.Pdp\TopLevelDomains::resolveacts likePdp\Rules::resolveand only throw onTypeError
Deprecated
- None
Removed
__toStringand__debugInfousage- Support for PHP7.4-
- Composer script for automatic updates of the remote databases
- CLI command
bin/update-psl Pdp\Cache,Pdp\CacheException: The package PSR-16 Cache implementation using the underlying filesystem.Pdp\HttpClient,Pdp\CurlHttpClientandPdp\HttpClientException: The package Http Client.Pdp\Installer,Pdp\Manager: The package source manager and installerPdp\Logger, The package logger implementationPdp\Rules::ALL_DOMAINSconstant deprecated in version 5.3Pdp\Domain::getDomaindeprecated in version 5.3Pdp\Domain::resolvePdp\Domain::getPublicSuffixreplaced byPdp\ResolvedDomain::suffixPdp\Domain::getRegistrableDomainreplaced byPdp\ResolvedDomain::registrableDomainPdp\Domain::getSubDomainreplaced byPdp\ResolvedDomain::subDomainPdp\Domain::withPublicSuffixreplaced byPdp\ResolvedDomain::withSuffixPdp\Domain::getLabelreplaced byPdp\Domain::labelPdp\Domain::isTransitionalDifferentreplaced byPdp\IdnaInfo::isTransitionalDifferentPdp\PublicSuffixreplaced byPdp\Suffix- Accessing suffix information from the
Pdp\Domainobject is no longer possible you need to do it fromPdp\Suffix Pdp\TopLevelDomains::containswithout replacement- Internal Converter classes (implementation details are no longer exposed).
Release notes
Open source →Added
- Adding proper Interfaces
- Added
Domain::clearto easily initialize an empty domain object - Added
Domain::sliceto easily slice a domain object - Added
ResolvedDomainobject to normalize Resolver results. - Added
Suffixobject to replace thePublicSuffixobject from v5. - Public Suffix List and IANA Top Level Domain List are fully decoupled
- Added
Idna, IDN support has been completely revamped - Added internal
Streamclass, to improve path/stream resolution - Resolver uses by default UTS#46 IDNA2008 algorithm to convert domain names
- Storage capability is now optional and can be based on PHP-FIG related interfaces to improve interoperability
Pdp\TopLevelDomains::getIANADomainwhich throws on syntax error and if no effective TLD is found (behave likePdp\TopLevelDomains::resolvein v5).
Fixed
- The
Pdp\Domainclass not longer directly exposes Effective TLD status. - Effective TLD resolver (
Pdp\Rules::resolveandPdp\TopLevelDomains::resolve) no longer accept IDNA options. Rules::getICANNDomain,Rules::getPrivateDomainwill throw even if aPublicSuffixis found but does not belong to the correct PSL section.Pdp\TopLevelDomains::resolveacts likePdp\Rules::resolveand only throw onTypeError
Deprecated
- None
Removed
__toStringand__debugInfousage- Support for PHP7.4-
- Composer script for automatic updates of the remote databases
- CLI command
bin/update-psl Pdp\Cache,Pdp\CacheException: The package PSR-16 Cache implementation using the underlying filesystem.Pdp\HttpClient,Pdp\CurlHttpClientandPdp\HttpClientException: The package Http Client.Pdp\Installer,Pdp\Manager: The package source manager and installerPdp\Logger, The package logger implementationPdp\Rules::ALL_DOMAINSconstant deprecated in version 5.3Pdp\Domain::getDomaindeprecated in version 5.3Pdp\Domain::resolvePdp\Domain::getPublicSuffixreplaced byPdp\ResolvedDomain::suffixPdp\Domain::getRegistrableDomainreplaced byPdp\ResolvedDomain::registrableDomainPdp\Domain::getSubDomainreplaced byPdp\ResolvedDomain::subDomainPdp\Domain::withPublicSuffixreplaced byPdp\ResolvedDomain::withSuffixPdp\Domain::getLabelreplaced byPdp\Domain::labelPdp\Domain::isTransitionalDifferentreplaced byPdp\IdnaInfo::isTransitionalDifferentPdp\PublicSuffixreplaced byPdp\Suffix- Accessing suffix information from the
Pdp\Domainobject is no longer possible you need to do it fromPdp\Suffix Pdp\TopLevelDomains::containswithout replacement- Internal Converter classes (implementation details are no longer exposed).
-
5.7.226 Oct 2020Release notes
Open source →Added
- None
Fixed
- Added support for PHP8 see #289 based on works by @szepeviktor
Deprecated
- None
Removed
- None
Release notes
Open source →Added
- None
Fixed
- Added support for PHP8 see #289 based on works by @szepeviktor
Deprecated
- None
Remove
- None
-
5.7.124 Aug 2020Release notes
Open source →Release notes
Open source → -
5.7.003 Aug 2020Release notes
Open source →Added
Rules::getCookieDomainRules::getICANNDomainRules::getPrivateDomainCouldNotResolvePublicSuffix::dueToUnresolvableDomain
Fixed
- Improve type hinting and return type by dropping EOL PHP versions support.
- Improve development environment by dropping EOL PHP versions support.
- Composer script
Deprecated
- None
Removed
- Support for PHP7.0 and PHP7.1
- The external data from IANA and mozilla is no longer part of the package and will be downloaded only on demand on composer update/install.
-
5.6.029 Dec 2019Release notes
Open source →Added
- A simple
Psr3compatible logger class which output the logs to you cli console.
Fixed
composer.jsonupdated to be composer 2.0 ready- package bundle installer is rewritten to improve its usage see #249 and #250
Deprecated
- None
Removed
- None
- A simple
-
5.5.014 Apr 2019Release notes
Open source →Added
-
PublicSuffix::labelsandDomain::labelsto return the VO labels see #241 -
IDNAConverterTrait::parse(internal)
Fixed
- Don't swallow cache errors #232
- Update travis settings to allow testing against future version of PHP.
Deprecated
IDNAConverterTrait::setLabelsreplaced byIDNAConverterTrait::parse(internal)
Removed
- None
-
5.4.022 Nov 2018Release notes
Open source →Added
Pdp\TopLevelDomainsto allow resolving domain againts IANA Root zone databasePdp\TLDConverterconverts the IANA Root Zones database into an associative arrayPdp\Manager::getTLDsa service to return a cache version of the IANA Root zone databasePdp\Manager::refreshTLDsa service to refresh the cache version of the IANA Root zone database- added a new
$ttlparameter to improve PSR-16 supports toPdp\Manager::__constructPdp\Manager::getRulesPdp\Manager::refreshRules
Pdp\Exception\CouldNotLoadTLDsexception
Fixed
Pdp\IDNAConverterTrait::setLabelsimprove IDN domain handlingPdp\IDNAConverterTraitthrows aUnexpectedValueExceptionif the Intl extension is misconfigured see #230
Deprecated
- None
Removed
- None
-
5.3.022 May 2018Release notes
Open source →Added
Pdp\PublicSuffixListSectioninterface implemented byPdp\RulesandPdp\PublicSuffixPdp\DomainInterfaceinterface implemented byPdp\DomainandPdp\PublicSuffixPdp\Domain::getContentreplacesPdp\Domain::getDomainPdp\Domain::withLabeladds a new label to thePdp\Domain.Pdp\Domain::withoutLabelremoves labels from thePdp\Domain.Pdp\Domain::withPublicSuffixupdates thePdp\Domainpublic suffix part.Pdp\Domain::withSubDomainupdates thePdp\Domainsub domain part.Pdp\Domain::appendappends a label toPdp\Domain.Pdp\Domain::prependprepends a label toPdp\Domain.Pdp\Domain::resolveattach a public suffix to thePdp\Domain.Pdp\Domain::isResolvabletells whether the currentPdp\Domaincan have a public suffix attached to it or not.Pdp\PublicSuffix::createFromDomainreturns a newPdp\PublicSuffixobject from aPdp\DomainobjectPdp\Exceptionsub namespace to organize exception. All exception extends thePdp\Exceptionclass to prevent BC break.
Fixed
Pdp\Domaindomain part computation (public suffix, registrable domain and sub domain)Pdp\DomainandPdp\PublicSuffixhost validation compliance to RFC improved- Improve
Pdp\ConverterandPdp\Managerclass to better report error on IDN conversion. - Improve
Pdp\Installervendor directory resolution see PR #222 Pdp\Exceptionnows extendsInvalidArgumentExceptioninstead ofRuntimeException
Deprecated
Pdp\Domain::getDomainuse insteadPdp\Domain::getContentPdp\Rules::ALL_DOMAINSuse the empty string instead
Removed
- None
-
5.2.023 Feb 2018Release notes
Open source →Added
Pdp\Rules::getPublicSuffixreturns aPdp\PublicSuffixvalue objectPdp\Rules::__set_stateis implementedPdp\Domain::toUnicodereturns aPdp\Domainwith its value converted to its Unicode formPdp\Domain::toAsciireturns aPdp\Domainwith its value converted to its AScii formPdp\PublicSuffix::toUnicodereturns aPdp\PublicSuffixwith its value converted to its Unicode formPdp\PublicSuffix::toAsciireturns aPdp\PublicSuffixwith its value converted to its AScii form
Fixed
Pdp\Domain::getDomainreturns the normalized form of the domain namePdp\PublicSuffixis no longer internal.- Normalizes IDN conversion using a internal
IDNConverterTrait - Internal code improved by requiring PHPStan for development
Deprecated
- None
Removed
- None
-
5.1.018 Dec 2017Release notes
Open source →Added
Pdp\Rules::createFromPathnamed constructor to returns a new instance from a pathPdp\Rules::createFromStringnamed constructor to returns a new instance from a string
Fixed
- None
Deprecated
- None
Removed
- None
-
5.0.013 Dec 2017Release notes
Open source →Added
Pdp\Exceptiona base exception for the libraryPdp\Rulesa class to resolve domain name against the public suffix listPdp\Domainan immutable value object to represents a parsed domain namePdp\Installera class to enable improve PSL maintenancePdp\Cachea PSR-16 file cache implementation to cache a local copy of the PSLPdp\Managera class to enable managing PSL sources andRulesobjects creationPdp\Convertera class to convert the PSL into a PHP array
Fixed
- invalid domain names improved supported
- idn_* conversion error better handled
- domain name with RFC3986 encoded string improved supported
Deprecated
- None
Removed
- PHP5 support
- URL Parsing capabilities and domain name validation
Pdp\PublicSuffixListclass replaced by thePdp\RulesclassPdp\PublicSuffixManagerclass replaced by thePdp\ManagerclassPdp\HttpAdapter\HttpAdapterInterfaceinterface replaced by thePdp\HttpClientinterfacePdp\HttpAdapter\CurlHttpAdapterclass replaced by thePdp\CurlHttpClientclass
-
4.0.3-alpha28 Sep 2017 pre-releaseNothing published for this version
-
4.0.2-alpha28 Sep 2017 pre-releaseNothing published for this version
-
4.0.1-alpha21 Aug 2017 pre-releaseNothing published for this version
-
4.0.0-alpha08 Feb 2016 pre-releaseNothing published for this version
-
3.0.030 Mar 2015Nothing published for this version
-
2.0.316 Feb 2015Nothing published for this version
-
2.0.212 Feb 2015Nothing published for this version
-
2.0.127 Jan 2015Nothing published for this version
-
2.0.002 Jan 2015Nothing published for this version
-
1.4.628 Jul 2014Nothing published for this version
-
1.4.522 Jul 2014Nothing published for this version
-
1.4.421 Jul 2014Nothing published for this version
-
1.4.321 Jul 2014Nothing published for this version
-
1.4.221 Jul 2014Nothing published for this version
-
1.4.121 Jul 2014Nothing published for this version
-
1.4.021 Jul 2014Nothing published for this version
-
1.3.110 Jun 2014Nothing published for this version
-
1.3.015 May 2014Nothing published for this version
-
1.2.102 Feb 2014Nothing published for this version
-
1.2.002 Feb 2014Nothing published for this version
-
1.1.024 Dec 2013Nothing published for this version
-
1.0.023 Dec 2013Nothing published for this version
-
0.0.816 Oct 2013Nothing published for this version
-
0.0.727 Apr 2013Nothing published for this version
-
0.0.629 Jan 2013Nothing published for this version
-
0.0.524 Jan 2013Nothing published for this version
-
0.0.423 Jan 2013Nothing published for this version
-
0.0.317 Jan 2013Nothing published for this version
-
0.0.216 Jan 2013Nothing published for this version
-
0.0.115 Jan 2013Nothing published for this version