You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ If the domain name or some of its part are seriously malformed or unrecognized,
128
128
-`Pdp\Domain::isICANN` returns `true` if the public suffix is found in a selected PSL which includes the ICANN DOMAINS section;
129
129
-`Pdp\Domain::isPrivate` returns `true` if the public suffix is found in a selected PSL which includes the PRIVATE DOMAINS section;
130
130
131
-
**THIS EXAMPLE ILLUSTRATES HOW EACH OBJECT IS USED BUT SHOULD BE AVOID IN A PRODUCTON**
131
+
**THIS EXAMPLE ILLUSTRATES HOW EACH OBJECT IS USED BUT SHOULD BE AVOID IN PRODUCTON**
132
132
133
133
~~~php
134
134
<?php
@@ -239,6 +239,12 @@ The package comes bundle with:
239
239
240
240
#### Refreshing the cached PSL
241
241
242
+
~~~php
243
+
<?php
244
+
245
+
public Manager::refreshRules(string $source_url = self::PSL_URL): bool
246
+
~~~
247
+
242
248
The `Pdp\Manager::refreshRules` method enables refreshing your local copy of the PSL stored with your [PSR-16](http://www.php-fig.org/psr/psr-16/) Cache and retrieved using the Http Client. By default the method will use the `Manager::PSL_URL` as the source URL but you are free to substitute this URL with your own.
243
249
The method returns a boolean value which is `true` on success.
244
250
@@ -263,7 +269,7 @@ if ($retval) {
263
269
~~~php
264
270
<?php
265
271
266
-
public function getRules(string $source_url = self::PSL_URL): Rules
272
+
public Manager::getRules(string $source_url = self::PSL_URL): Rules
267
273
~~~
268
274
269
275
This method returns a `Rules` object which is instantiated with the PSL rules.
@@ -314,6 +320,18 @@ This script requires:
314
320
- The `Pdp\Installer` class which organizes how to update the cache.
315
321
- The `Pdp\Cache` and `Pdp\CurlHttpClient` classes to retrieve and cache the PSL
316
322
323
+
You can also add a composer script in your `composer.json` file to update the PSL cache everytime after the `install` or the `update` command are executed.
0 commit comments