Skip to content

Commit 5e5e6df

Browse files
author
Jeremy Kendall
committed
Adds parse vendor binary to README
1 parent c69af23 commit 5e5e6df

File tree

1 file changed

+40
-7
lines changed

1 file changed

+40
-7
lines changed

README.md

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,57 @@ string(16) "scottwills.co.uk"
157157
string(5) "co.uk"
158158
```
159159

160+
### Sanity Check ###
161+
162+
You can quickly parse a url from the command line with the provided `parse`
163+
vendor binary. From the root of your project, simply call:
164+
165+
``` bash
166+
$ ./vendor/bin/parse <url>
167+
```
168+
169+
If you pass a url to `parse`, that url will be parsed and the output printed
170+
to screen.
171+
172+
If you do not pass a url, `http://user:[email protected]:8080/path/to/page.html?query=string#fragment` will be parsed and the output printed to screen.
173+
174+
Example:
175+
176+
``` bash
177+
$ ./vendor/bin/parse http://www.waxaudio.com.au/
178+
179+
Array
180+
(
181+
[scheme] => http
182+
[user] =>
183+
[pass] =>
184+
[host] => www.waxaudio.com.au
185+
[subdomain] => www
186+
[registerableDomain] => waxaudio.com.au
187+
[publicSuffix] => com.au
188+
[port] =>
189+
[path] => /
190+
[query] =>
191+
[fragment] =>
192+
)
193+
```
194+
160195
### Example Script ###
161196

162197
For more information on using the PHP Domain Parser, please see the provided
163-
[example
164-
script](https://github.com/jeremykendall/php-domain-parser/blob/master/example.php).
198+
[example script](https://github.com/jeremykendall/php-domain-parser/blob/master/example.php).
165199

166200
### Refreshing the Public Suffix List ###
167201

168202
While a cached PHP copy of the Public Suffix List is provided for you in the
169203
`data` directory, that copy may or may not be up to date (Mozilla provides an
170-
[Atom change
171-
feed](http://hg.mozilla.org/mozilla-central/atom-log/default/netwerk/dns/effective_tld_names.dat) to keep
172-
up with changes to the list). Please use the provided vendor binary to refresh
173-
your cached copy of the Public Suffix List.
204+
[Atom change feed](http://hg.mozilla.org/mozilla-central/atom-log/default/netwerk/dns/effective_tld_names.dat)
205+
to keep up with changes to the list). Please use the provided vendor binary to
206+
refresh your cached copy of the Public Suffix List.
174207

175208
From the root of your project, simply call:
176209

177-
```
210+
``` bash
178211
$ ./vendor/bin/pdp-psl
179212
```
180213

0 commit comments

Comments
 (0)