Skip to content

Commit 633af36

Browse files
committed
improve documentation
1 parent c270b9d commit 633af36

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $ composer require jeremykendall/php-domain-parser
4444
Documentation
4545
--------
4646

47-
### Public Suffix Manager
47+
### Public Suffix List Maintenance
4848

4949
~~~php
5050
<?php
@@ -100,7 +100,7 @@ By default and out of the box, the package uses:
100100
- a file cache PSR-16 implementation based on the excellent [FileCache](https://github.com/kodus/file-cache) which **caches the local copy for a maximum of 7 days**.
101101
- a HTTP client based on the cURL extension.
102102

103-
#### Accessing the Public Suffix rules
103+
#### Accessing the Public Suffix List rules
104104

105105
~~~php
106106
<?php
@@ -126,7 +126,7 @@ use Pdp\Manager;
126126

127127
$manager = new Manager(new Cache(), new CurlHttpClient());
128128
$rules = $manager->getRules('https://publicsuffix.org/list/public_suffix_list.dat');
129-
$rules->resolve('www.bébé.be');
129+
$domain = $rules->resolve('www.bébé.be');
130130
~~~
131131

132132
#### Refreshing the cached rules
@@ -165,7 +165,7 @@ If you prefer using your own implementations you should:
165165
2. Adapt its code to reflect your requirements.
166166

167167

168-
In any cases your are required to register a cron with your chosen script to keep your data up to date
168+
In any cases your are required to update regularly your PSL information with your chosen script to keep your data up to date.
169169

170170
For example, below I'm using the `Manager` with
171171

@@ -205,7 +205,7 @@ final class GuzzleHttpClientAdapter implements HttpClient
205205
}
206206

207207
$dbh = new PDO('mysql:dbname=testdb;host=127.0.0.1', 'dbuser', 'dbpass');
208-
$symfonyCache = new PDOCache($dbh, 'league-psl-icann', 86400);
208+
$symfonyCache = new PDOCache($dbh, 'psl', 86400);
209209
$guzzleAdapter = new GuzzleHttpClientAdapter(new GuzzleClient());
210210
$manager = new Manager($symfonyCache, $guzzleAdapter);
211211
$manager->refreshRules();
@@ -218,16 +218,13 @@ $domain->getDomain(); //returns 'nl.shop.bébé.faketld'
218218
$domain->getPublicSuffix(); //returns 'faketld'
219219
$domain->getRegistrableDomain(); //returns 'bébé.faketld'
220220
$domain->getSubDomain(); //returns 'nl.shop'
221-
$domain->isValid(); //returns false
221+
$domain->isKnown(); //returns false
222222
~~~
223223

224224
In any case, you should setup a cron to regularly update your local cache.
225225

226226

227-
### Public Suffix Resolver
228-
229-
230-
#### Public Suffix and Domain Resolution
227+
### Domain Resolution
231228

232229
~~~php
233230
<?php
@@ -328,7 +325,7 @@ Credits
328325

329326
- [Jeremy Kendall](https://github.com/jeremykendall)
330327
- [ignace nyamagana butera](https://github.com/nyamsprod)
331-
- [All Contributors](https://github.com/thephpleague/uri/contributors)
328+
- [All Contributors](https://github.com/jeremykendall/php-domain-parser/contributors)
332329

333330
License
334331
-------

0 commit comments

Comments
 (0)