File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,18 @@ echo $domain->toAscii()->getContent(); // 'fass.test.de'
106
106
107
107
~~~ php
108
108
$manager = new Manager(new Cache(), new CurlHttpClient());
109
- $rules = $manager->getRules(Manager::PSL_URL, null, IDNA_NONTRANSITIONAL_TO_ASCII,
110
- IDNA_NONTRANSITIONAL_TO_UNICODE);
109
+ $rules = $manager->getRules()
110
+ ->withAsciiIDNAOption(IDNA_NONTRANSITIONAL_TO_ASCII)
111
+ ->withUnicodeIDNAOption(IDNA_NONTRANSITIONAL_TO_UNICODE);
112
+
111
113
// or
112
- // $rules = $rules
113
- // ->withAsciiIDNAOption(IDNA_NONTRANSITIONAL_TO_ASCII)
114
- // ->withUnicodeIDNAOption(IDNA_NONTRANSITIONAL_TO_UNICODE);
114
+ //
115
+ // $rules = $manager->getRules(
116
+ // Manager::PSL_URL,
117
+ // null,
118
+ // IDNA_NONTRANSITIONAL_TO_ASCII,
119
+ // IDNA_NONTRANSITIONAL_TO_UNICODE
120
+ // );
115
121
116
122
$domain = $rules->resolve('faß.test.de');
117
123
echo $domain->toAscii()->getContent(); // 'xn--fa-hia.test.de'
You can’t perform that action at this time.
0 commit comments