Skip to content

Commit 330903c

Browse files
Document ext/uri (#5392)
Co-authored-by: Jordi Kroon <jkroon@onyourmarks.agency>
1 parent ddc2a2d commit 330903c

74 files changed

Lines changed: 6152 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>

language-snippets.ent

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4736,6 +4736,19 @@ local: {
47364736
</listitem>
47374737
'>
47384738

4739+
<!-- URI snippets -->
4740+
<!ENTITY uri.errors.invalidUriException '
4741+
<simpara>
4742+
If the resulting URI is invalid, a <exceptionname>Uri\InvalidUriException</exceptionname> is thrown.
4743+
</simpara>
4744+
'>
4745+
4746+
<!ENTITY uri.errors.invalidUrlException '
4747+
<simpara>
4748+
If the resulting URL is invalid, a <exceptionname>Uri\WhatWg\InvalidUrlException</exceptionname> is thrown.
4749+
</simpara>
4750+
'>
4751+
47394752
<!-- UOPZ snippets -->
47404753

47414754
<!ENTITY uopz.warn.removed.function-5-0-0 '<warning

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+
<simpara>
16+
Constructs the <classname>Uri\Rfc3986\Uri</classname> object.
17+
</simpara>
18+
</refsect1>
19+
20+
<refsect1 role="parameters">
21+
&reftitle.parameters;
22+
<variablelist>
23+
<varlistentry>
24+
<term><parameter>uri</parameter></term>
25+
<listitem>
26+
<simpara>
27+
URI to parse.
28+
</simpara>
29+
</listitem>
30+
</varlistentry>
31+
<varlistentry>
32+
<term><parameter>baseUrl</parameter></term>
33+
<listitem>
34+
<simpara>
35+
When a &string; is passed, <parameter>uri</parameter> is applied on
36+
<parameter>baseUrl</parameter>, if <parameter>uri</parameter> is a relative reference.
37+
If either &null; is passed, or <parameter>uri</parameter> is a not a relative reference, then
38+
<parameter>baseUrl</parameter> doesn't have any effect.
39+
</simpara>
40+
</listitem>
41+
</varlistentry>
42+
</variablelist>
43+
</refsect1>
44+
45+
<refsect1 role="errors">
46+
&reftitle.errors;
47+
&uri.errors.invalidUriException;
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\Rfc3986\Uri::resolve</methodname></member>
55+
<member><methodname>Uri\WhatWg\Url::__construct</methodname></member>
56+
</simplelist>
57+
</refsect1>
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: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
<simpara>
15+
Returns the internal state of the URI.
16+
</simpara>
17+
</refsect1>
18+
19+
<refsect1 role="parameters">
20+
&reftitle.parameters;
21+
&no.function.parameters;
22+
</refsect1>
23+
24+
<refsect1 role="returnvalues">
25+
&reftitle.returnvalues;
26+
<simpara>
27+
Returns the internal state of the URI as an &array;.
28+
</simpara>
29+
</refsect1>
30+
31+
<refsect1 role="seealso">
32+
&reftitle.seealso;
33+
<simplelist>
34+
<member><methodname>Uri\WhatWg\Url::__debugInfo</methodname></member>
35+
</simplelist>
36+
</refsect1>
37+
</refentry>
38+
<!-- Keep this comment at the end of the file
39+
Local variables:
40+
mode: sgml
41+
sgml-omittag:t
42+
sgml-shorttag:t
43+
sgml-minimize-attributes:nil
44+
sgml-always-quote-attributes:t
45+
sgml-indent-step:1
46+
sgml-indent-data:t
47+
indent-tabs-mode:nil
48+
sgml-parent-document:nil
49+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
50+
sgml-exposed-tags:nil
51+
sgml-local-catalogs:nil
52+
sgml-local-ecat-files:nil
53+
End:
54+
vim600: syn=xml fen fdm=syntax fdl=2 si
55+
vim: et tw=78 syn=sgml
56+
vi: ts=1 sw=1
57+
-->
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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+
<simpara>
16+
Checks if two URIs are equivalent.
17+
</simpara>
18+
</refsect1>
19+
20+
<refsect1 role="parameters">
21+
&reftitle.parameters;
22+
<variablelist>
23+
<varlistentry>
24+
<term><parameter>uri</parameter></term>
25+
<listitem>
26+
<simpara>
27+
URI to compare the current URI against.
28+
</simpara>
29+
</listitem>
30+
</varlistentry>
31+
<varlistentry>
32+
<term><parameter>comparisonMode</parameter></term>
33+
<listitem>
34+
<simpara>
35+
Whether the fragment component is taken into account of the comparison
36+
(<literal>Uri\UriComparisonMode::IncludeFragment</literal>) or not
37+
(<literal>Uri\UriComparisonMode::ExcludeFragment</literal>). By default, the fragment is excluded.
38+
</simpara>
39+
</listitem>
40+
</varlistentry>
41+
</variablelist>
42+
</refsect1>
43+
44+
<refsect1 role="returnvalues">
45+
&reftitle.returnvalues;
46+
<simpara>
47+
Returns &true; if the two URIs are equivalent, or &false; otherwise.
48+
</simpara>
49+
</refsect1>
50+
51+
<refsect1 role="examples">
52+
&reftitle.examples;
53+
<example xml:id="uri-rfc3986-uri.equals.example.basic">
54+
<title><methodname>Uri\Rfc3986\Uri::equals</methodname> basic example</title>
55+
<programlisting role="php">
56+
<![CDATA[
57+
<?php
58+
$uri1 = new \Uri\Rfc3986\Uri("https://example.com");
59+
$uri2 = new \Uri\Rfc3986\Uri("HTTPS://example.com");
60+
61+
var_dump($uri1->equals($uri2));
62+
?>
63+
]]>
64+
</programlisting>
65+
&example.outputs;
66+
<screen>
67+
<![CDATA[
68+
bool(true)
69+
]]>
70+
</screen>
71+
</example>
72+
</refsect1>
73+
74+
<refsect1 role="seealso">
75+
&reftitle.seealso;
76+
<simplelist>
77+
<member><methodname>Uri\WhatWg\Url::equals</methodname></member>
78+
</simplelist>
79+
</refsect1>
80+
</refentry>
81+
<!-- Keep this comment at the end of the file
82+
Local variables:
83+
mode: sgml
84+
sgml-omittag:t
85+
sgml-shorttag:t
86+
sgml-minimize-attributes:nil
87+
sgml-always-quote-attributes:t
88+
sgml-indent-step:1
89+
sgml-indent-data:t
90+
indent-tabs-mode:nil
91+
sgml-parent-document:nil
92+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
93+
sgml-exposed-tags:nil
94+
sgml-local-catalogs:nil
95+
sgml-local-ecat-files:nil
96+
End:
97+
vim600: syn=xml fen fdm=syntax fdl=2 si
98+
vim: et tw=78 syn=sgml
99+
vi: ts=1 sw=1
100+
-->

0 commit comments

Comments
 (0)