Skip to content

Commit cf4e2b8

Browse files
Document ext/uri
Co-authored-by: Jordi Kroon <jkroon@onyourmarks.agency>
1 parent 5f1a920 commit cf4e2b8

71 files changed

Lines changed: 6083 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

appendices/extensions.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
<listitem><simpara><xref linkend="book.ui"/></simpara></listitem>
164164
<listitem><simpara><xref linkend="book.uodbc"/></simpara></listitem>
165165
<listitem><simpara><xref linkend="book.uopz"/></simpara></listitem>
166+
<listitem><simpara><xref linkend="book.uri"/></simpara></listitem>
166167
<listitem><simpara><xref linkend="book.url"/></simpara></listitem>
167168
<listitem><simpara><xref linkend="book.v8js"/></simpara></listitem>
168169
<listitem><simpara><xref linkend="book.var"/></simpara></listitem>
@@ -228,6 +229,7 @@
228229
<listitem><para><xref linkend="book.spl"/></para></listitem>
229230
<listitem><para><xref linkend="book.stream"/></para></listitem>
230231
<listitem><para><xref linkend="book.strings"/></para></listitem>
232+
<listitem><para><xref linkend="book.uri"/></para></listitem>
231233
<listitem><para><xref linkend="book.url"/></para></listitem>
232234
<listitem><para><xref linkend="book.var"/></para></listitem>
233235
</itemizedlist>

reference/uri/book.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<book xml:id="book.uri" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" annotations="interactive">
3+
<?phpdoc extension-membership="core" ?>
4+
<title>URI</title>
5+
<titleabbrev>URI</titleabbrev>
6+
7+
<preface xml:id="intro.uri">
8+
&reftitle.intro;
9+
<simpara>
10+
This chapter describes the functions that allow you to work with
11+
Uniform Resource Identifiers (URIs). A URI is a string of characters
12+
used to identify a resource. URIs are used in web technologies to
13+
identify resources on the Internet.
14+
</simpara>
15+
<simpara>
16+
URI implements RFC 3986, Uniform Resource Identifier (URI): Generic Syntax,
17+
which can be found at <link xlink:href="http://www.ietf.org/rfc/rfc3986.txt">http://www.ietf.org/rfc/rfc3986.txt</link>.
18+
And WHATWG URL Standard, which can be found at
19+
<link xlink:href="https://url.spec.whatwg.org/">https://url.spec.whatwg.org/</link>.
20+
</simpara>
21+
</preface>
22+
23+
&reference.uri.uri.invaliduriexception;
24+
&reference.uri.uri.urierror;
25+
&reference.uri.uri.uriexception;
26+
27+
&reference.uri.uri.rfc3986.uri;
28+
29+
&reference.uri.uri.whatwg.invalidurlexception;
30+
&reference.uri.uri.whatwg.url;
31+
&reference.uri.uri.whatwg.urlvalidationerror;
32+
</book>
33+
<!-- Keep this comment at the end of the file
34+
Local variables:
35+
mode: sgml
36+
sgml-omittag:t
37+
sgml-shorttag:t
38+
sgml-minimize-attributes:nil
39+
sgml-always-quote-attributes:t
40+
sgml-indent-step:1
41+
sgml-indent-data:t
42+
indent-tabs-mode:nil
43+
sgml-parent-document:nil
44+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
45+
sgml-exposed-tags:nil
46+
sgml-local-catalogs:nil
47+
sgml-local-ecat-files:nil
48+
End:
49+
vim600: syn=xml fen fdm=syntax fdl=2 si
50+
vim: et tw=78 syn=sgml
51+
vi: ts=1 sw=1
52+
-->
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<refentry xml:id="uri-rfc3986-uri.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<refnamediv>
4+
<refname>Uri\Rfc3986\Uri::__construct</refname>
5+
<refpurpose>Construct the Uri object</refpurpose>
6+
</refnamediv>
7+
8+
<refsect1 role="description">
9+
&reftitle.description;
10+
<constructorsynopsis role="Uri\\Rfc3986\\Uri">
11+
<modifier>public</modifier> <methodname>Uri\Rfc3986\Uri::__construct</methodname>
12+
<methodparam><type>string</type><parameter>uri</parameter></methodparam>
13+
<methodparam choice="opt"><type class="union"><type>Uri\Rfc3986\Uri</type><type>null</type></type><parameter>baseUrl</parameter><initializer>&null;</initializer></methodparam>
14+
</constructorsynopsis>
15+
&warn.undocumented.func;
16+
<simpara>
17+
Description.
18+
</simpara>
19+
</refsect1>
20+
21+
<refsect1 role="parameters">
22+
&reftitle.parameters;
23+
<variablelist>
24+
<varlistentry>
25+
<term><parameter>uri</parameter></term>
26+
<listitem>
27+
<simpara>
28+
URI to parse.
29+
</simpara>
30+
</listitem>
31+
</varlistentry>
32+
<varlistentry>
33+
<term><parameter>baseUrl</parameter></term>
34+
<listitem>
35+
<simpara>
36+
Description.
37+
</simpara>
38+
</listitem>
39+
</varlistentry>
40+
</variablelist>
41+
</refsect1>
42+
43+
<refsect1 role="errors">
44+
&reftitle.errors;
45+
<simpara>
46+
If the resulting URI is invalid, a <exceptionname>Uri\InvalidUriException</exceptionname> is thrown.
47+
</simpara>
48+
</refsect1>
49+
50+
<refsect1 role="seealso">
51+
&reftitle.seealso;
52+
<simplelist>
53+
<member><methodname>Uri\Rfc3986\Uri::parse</methodname></member>
54+
<member><methodname>Uri\WhatWg\Url::__construct</methodname></member>
55+
</simplelist>
56+
</refsect1>
57+
58+
</refentry>
59+
<!-- Keep this comment at the end of the file
60+
Local variables:
61+
mode: sgml
62+
sgml-omittag:t
63+
sgml-shorttag:t
64+
sgml-minimize-attributes:nil
65+
sgml-always-quote-attributes:t
66+
sgml-indent-step:1
67+
sgml-indent-data:t
68+
indent-tabs-mode:nil
69+
sgml-parent-document:nil
70+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
71+
sgml-exposed-tags:nil
72+
sgml-local-catalogs:nil
73+
sgml-local-ecat-files:nil
74+
End:
75+
vim600: syn=xml fen fdm=syntax fdl=2 si
76+
vim: et tw=78 syn=sgml
77+
vi: ts=1 sw=1
78+
-->
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<refentry xml:id="uri-rfc3986-uri.debuginfo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<refnamediv>
4+
<refname>Uri\Rfc3986\Uri::__debugInfo</refname>
5+
<refpurpose>Return the internal state of the URI</refpurpose>
6+
</refnamediv>
7+
8+
<refsect1 role="description">
9+
&reftitle.description;
10+
<methodsynopsis role="Uri\\Rfc3986\\Uri">
11+
<modifier>public</modifier> <type>array</type><methodname>Uri\Rfc3986\Uri::__debugInfo</methodname>
12+
<void/>
13+
</methodsynopsis>
14+
&warn.undocumented.func;
15+
<simpara>
16+
Description.
17+
</simpara>
18+
</refsect1>
19+
20+
<refsect1 role="parameters">
21+
&reftitle.parameters;
22+
&no.function.parameters;
23+
</refsect1>
24+
25+
<refsect1 role="returnvalues">
26+
&reftitle.returnvalues;
27+
<simpara>
28+
Returns the internal state of the URI as an &array;.
29+
</simpara>
30+
</refsect1>
31+
32+
<refsect1 role="seealso">
33+
&reftitle.seealso;
34+
<simplelist>
35+
<member><methodname>Uri\WhatWg\Url::__debugInfo</methodname></member>
36+
</simplelist>
37+
</refsect1>
38+
39+
</refentry>
40+
<!-- Keep this comment at the end of the file
41+
Local variables:
42+
mode: sgml
43+
sgml-omittag:t
44+
sgml-shorttag:t
45+
sgml-minimize-attributes:nil
46+
sgml-always-quote-attributes:t
47+
sgml-indent-step:1
48+
sgml-indent-data:t
49+
indent-tabs-mode:nil
50+
sgml-parent-document:nil
51+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
52+
sgml-exposed-tags:nil
53+
sgml-local-catalogs:nil
54+
sgml-local-ecat-files:nil
55+
End:
56+
vim600: syn=xml fen fdm=syntax fdl=2 si
57+
vim: et tw=78 syn=sgml
58+
vi: ts=1 sw=1
59+
-->
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<refentry xml:id="uri-rfc3986-uri.equals" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<refnamediv>
4+
<refname>Uri\Rfc3986\Uri::equals</refname>
5+
<refpurpose>Check if two URIs are equivalent</refpurpose>
6+
</refnamediv>
7+
8+
<refsect1 role="description">
9+
&reftitle.description;
10+
<methodsynopsis role="Uri\\Rfc3986\\Uri">
11+
<modifier>public</modifier> <type>bool</type><methodname>Uri\Rfc3986\Uri::equals</methodname>
12+
<methodparam><type>Uri\Rfc3986\Uri</type><parameter>uri</parameter></methodparam>
13+
<methodparam choice="opt"><type>Uri\UriComparisonMode</type><parameter>comparisonMode</parameter><initializer><constant>Uri\UriComparisonMode::ExcludeFragment</constant></initializer></methodparam>
14+
</methodsynopsis>
15+
&warn.undocumented.func;
16+
<simpara>
17+
Description.
18+
</simpara>
19+
</refsect1>
20+
21+
<refsect1 role="parameters">
22+
&reftitle.parameters;
23+
<variablelist>
24+
<varlistentry>
25+
<term><parameter>uri</parameter></term>
26+
<listitem>
27+
<simpara>
28+
URI to compare the current URI against.
29+
</simpara>
30+
</listitem>
31+
</varlistentry>
32+
<varlistentry>
33+
<term><parameter>comparisonMode</parameter></term>
34+
<listitem>
35+
<simpara>
36+
Description.
37+
</simpara>
38+
</listitem>
39+
</varlistentry>
40+
</variablelist>
41+
</refsect1>
42+
43+
<refsect1 role="returnvalues">
44+
&reftitle.returnvalues;
45+
<simpara>
46+
Returns &true; if the two URIs are equivalent, or &false; otherwise.
47+
</simpara>
48+
</refsect1>
49+
50+
<refsect1 role="examples">
51+
&reftitle.examples;
52+
<example xml:id="uri-rfc3986-uri.equals.example.basic">
53+
<title><methodname>Uri\Rfc3986\Uri::equals</methodname> example</title>
54+
<simpara>
55+
Description.
56+
</simpara>
57+
<programlisting role="php">
58+
<![CDATA[
59+
<?php
60+
$uri1 = new \Uri\Rfc3986\Uri("https://example.com");
61+
$uri2 = new \Uri\Rfc3986\Uri("HTTPS://example.com");
62+
63+
var_dump($uri1->equals($uri2));
64+
?>
65+
]]>
66+
</programlisting>
67+
&example.outputs;
68+
<screen>
69+
<![CDATA[
70+
bool(true)
71+
]]>
72+
</screen>
73+
</example>
74+
</refsect1>
75+
76+
<refsect1 role="seealso">
77+
&reftitle.seealso;
78+
<simplelist>
79+
<member><methodname>Uri\WhatWg\Url::equals</methodname></member>
80+
</simplelist>
81+
</refsect1>
82+
83+
</refentry>
84+
<!-- Keep this comment at the end of the file
85+
Local variables:
86+
mode: sgml
87+
sgml-omittag:t
88+
sgml-shorttag:t
89+
sgml-minimize-attributes:nil
90+
sgml-always-quote-attributes:t
91+
sgml-indent-step:1
92+
sgml-indent-data:t
93+
indent-tabs-mode:nil
94+
sgml-parent-document:nil
95+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
96+
sgml-exposed-tags:nil
97+
sgml-local-catalogs:nil
98+
sgml-local-ecat-files:nil
99+
End:
100+
vim600: syn=xml fen fdm=syntax fdl=2 si
101+
vim: et tw=78 syn=sgml
102+
vi: ts=1 sw=1
103+
-->
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<refentry xml:id="uri-rfc3986-uri.getfragment" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<refnamediv>
4+
<refname>Uri\Rfc3986\Uri::getFragment</refname>
5+
<refpurpose>Retrieve the normalized fragment component</refpurpose>
6+
</refnamediv>
7+
8+
<refsect1 role="description">
9+
&reftitle.description;
10+
<methodsynopsis role="Uri\\Rfc3986\\Uri">
11+
<modifier>public</modifier> <type class="union"><type>string</type><type>null</type></type><methodname>Uri\Rfc3986\Uri::getFragment</methodname>
12+
<void/>
13+
</methodsynopsis>
14+
&warn.undocumented.func;
15+
<simpara>
16+
Description.
17+
</simpara>
18+
</refsect1>
19+
20+
<refsect1 role="parameters">
21+
&reftitle.parameters;
22+
&no.function.parameters;
23+
</refsect1>
24+
25+
<refsect1 role="returnvalues">
26+
&reftitle.returnvalues;
27+
<simpara>
28+
Returns the normalized fragment component as a &string; if the fragment component exists, &null; is returned otherwise.
29+
</simpara>
30+
</refsect1>
31+
32+
<refsect1 role="examples">
33+
&reftitle.examples;
34+
<example xml:id="uri-rfc3986-uri.getfragment.example.basic">
35+
<title><methodname>Uri\Rfc3986\Uri::getFragment</methodname> example</title>
36+
<simpara>
37+
Description.
38+
</simpara>
39+
<programlisting role="php">
40+
<![CDATA[
41+
<?php
42+
$uri = new \Uri\Rfc3986\Uri("https://example.com?foo=bar");
43+
44+
echo $uri->getFragment();
45+
?>
46+
]]>
47+
</programlisting>
48+
&example.outputs;
49+
<screen>
50+
<![CDATA[
51+
foo=bar
52+
]]>
53+
</screen>
54+
</example>
55+
</refsect1>
56+
57+
<refsect1 role="seealso">
58+
&reftitle.seealso;
59+
<simplelist>
60+
<member><methodname>Uri\Rfc3986\Uri::getRawFragment</methodname></member>
61+
<member><methodname>Uri\Rfc3986\Uri::withFragment</methodname></member>
62+
<member><methodname>Uri\WhatWg\Url::getFragment</methodname></member>
63+
</simplelist>
64+
</refsect1>
65+
66+
</refentry>
67+
<!-- Keep this comment at the end of the file
68+
Local variables:
69+
mode: sgml
70+
sgml-omittag:t
71+
sgml-shorttag:t
72+
sgml-minimize-attributes:nil
73+
sgml-always-quote-attributes:t
74+
sgml-indent-step:1
75+
sgml-indent-data:t
76+
indent-tabs-mode:nil
77+
sgml-parent-document:nil
78+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
79+
sgml-exposed-tags:nil
80+
sgml-local-catalogs:nil
81+
sgml-local-ecat-files:nil
82+
End:
83+
vim600: syn=xml fen fdm=syntax fdl=2 si
84+
vim: et tw=78 syn=sgml
85+
vi: ts=1 sw=1
86+
-->

0 commit comments

Comments
 (0)