@@ -228,6 +228,13 @@ supported type to avoid unexpected results. By default, if the input is not a
228
228
` Pdp\Suffix ` instance, the resulting public suffix will be labelled as
229
229
being unknown. For more information go to the [ Public Suffix section] ( #public-suffix )
230
230
231
+ > [ !INFO]
232
+ > Since version ` 6.4 ` Domain resolution is also adapted so that absolute domain
233
+ can effectively be resolved. Prior to version ` 6.4 ` an exception was thrown.
234
+ The ` ResolvedDomain ` stays the same as with the equivalent non-absolute domain
235
+ but with the only difference being that the resolved domain will be absolute.
236
+ Everything else stays the same.
237
+
231
238
### Domain Suffix
232
239
233
240
The domain effective TLD is represented using the ` Pdp\Suffix ` . Depending on
@@ -342,6 +349,26 @@ $newDomain->clear()->labels(); //return []
342
349
echo $domain->slice(2)->toString(); //display 'www'
343
350
~~~
344
351
352
+ Starting with version ` 6.4 ` it is possible to specify and handle absolute domain
353
+ with the following methods.
354
+
355
+ ~~~ php
356
+ <?php
357
+ use Pdp\Domain;
358
+ use Pdp\Rules;
359
+
360
+ /** @var Rules $publicSuffixList */
361
+ $domain = $publicSuffixList->resolve(Domain::from2008('www.ExAmpLE.cOM'))->domain();
362
+ $newDomain = $domain->withRootLabel();
363
+
364
+ echo $domain->toString(); //display 'www.example.com'
365
+ echo $newDomain->toString(); //display 'www.example.com.www.'
366
+ $domain->isAbsolute(); //return false
367
+ $newDomain->isAbsolute() //return true
368
+
369
+ $domain->value() === $newDomain->withoutRootLabel()->value();
370
+ ~~~
371
+
345
372
> [ !WARNING]
346
373
> Because of its definition, a domain name can be ` null ` or a string.
347
374
0 commit comments