Skip to content

Commit 2df0650

Browse files
committed
PHP 8.4: Document new XMLReader methods
1 parent b34210e commit 2df0650

File tree

4 files changed

+265
-0
lines changed

4 files changed

+265
-0
lines changed

reference/xmlreader/versions.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
<function name="xmlreader" from="PHP 5 &gt;= 5.1.0, PHP 7, PHP 8"/>
99
<function name="xmlreader::close" from="PHP 5 &gt;= 5.1.0, PHP 7, PHP 8"/>
1010
<function name="xmlreader::expand" from="PHP 5 &gt;= 5.1.0, PHP 7, PHP 8"/>
11+
<function name="xmlreader::fromstream" from="PHP 8 &gt;= 8.4.0"/>
12+
<function name="xmlreader::fromstring" from="PHP 8 &gt;= 8.4.0"/>
13+
<function name="xmlreader::fromuri" from="PHP 8 &gt;= 8.4.0"/>
1114
<function name="xmlreader::getattribute" from="PHP 5 &gt;= 5.1.0, PHP 7, PHP 8"/>
1215
<function name="xmlreader::getattributeno" from="PHP 5 &gt;= 5.1.0, PHP 7, PHP 8"/>
1316
<function name="xmlreader::getattributens" from="PHP 5 &gt;= 5.1.0, PHP 7, PHP 8"/>
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<refentry xml:id="xmlreader.fromstream" xmlns="http://docbook.org/ns/docbook">
4+
<refnamediv>
5+
<refname>XMLReader::fromStream</refname>
6+
<refpurpose>Creates an <classname>XMLReader</classname> from a stream to read from</refpurpose>
7+
</refnamediv>
8+
9+
<refsect1 role="description">
10+
&reftitle.description;
11+
<methodsynopsis role="XMLReader">
12+
<modifier>public</modifier> <modifier>static</modifier> <type>static</type><methodname>XMLReader::fromStream</methodname>
13+
<methodparam><type>resource</type><parameter>stream</parameter></methodparam>
14+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
15+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
16+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>documentUri</parameter><initializer>&null;</initializer></methodparam>
17+
</methodsynopsis>
18+
<simpara>
19+
Creates an <classname>XMLReader</classname> from a stream to read from.
20+
</simpara>
21+
</refsect1>
22+
23+
<refsect1 role="parameters">
24+
&reftitle.parameters;
25+
<variablelist>
26+
<varlistentry>
27+
<term><parameter>stream</parameter></term>
28+
<listitem>
29+
<simpara>
30+
The stream to read the XML from.
31+
</simpara>
32+
</listitem>
33+
</varlistentry>
34+
<varlistentry>
35+
<term><parameter>encoding</parameter></term>
36+
<listitem>
37+
<simpara>
38+
The document encoding or &null;.
39+
</simpara>
40+
</listitem>
41+
</varlistentry>
42+
<varlistentry>
43+
<term><parameter>flags</parameter></term>
44+
<listitem>
45+
<simpara>
46+
A bitmask of the <link linkend="libxml.constants">LIBXML_*</link>
47+
constants.
48+
</simpara>
49+
</listitem>
50+
</varlistentry>
51+
<varlistentry>
52+
<term><parameter>documentUri</parameter></term>
53+
<listitem>
54+
<simpara>
55+
Optional document base URI.
56+
</simpara>
57+
</listitem>
58+
</varlistentry>
59+
</variablelist>
60+
</refsect1>
61+
62+
<refsect1 role="returnvalues">
63+
&reftitle.returnvalues;
64+
<simpara>
65+
Returns an <classname>XMLReader</classname>.
66+
</simpara>
67+
</refsect1>
68+
69+
<refsect1 role="errors">
70+
&reftitle.errors;
71+
<itemizedlist>
72+
<listitem>
73+
<simpara>
74+
Passing an invalid <parameter>encoding</parameter> will throw a
75+
<exceptionname>ValueError</exceptionname>.
76+
</simpara>
77+
</listitem>
78+
<listitem>
79+
<simpara>
80+
Passing a resource that is not a stream to <parameter>stream</parameter>
81+
will throw a <exceptionname>TypeError</exceptionname>.
82+
</simpara>
83+
</listitem>
84+
</itemizedlist>
85+
</refsect1>
86+
87+
<refsect1 role="seealso">
88+
&reftitle.seealso;
89+
<simplelist>
90+
<member><methodname>XMLReader::fromString</methodname></member>
91+
<member><methodname>XMLReader::fromUri</methodname></member>
92+
</simplelist>
93+
</refsect1>
94+
</refentry>
95+
<!-- Keep this comment at the end of the file
96+
Local variables:
97+
mode: sgml
98+
sgml-omittag:t
99+
sgml-shorttag:t
100+
sgml-minimize-attributes:nil
101+
sgml-always-quote-attributes:t
102+
sgml-indent-step:1
103+
sgml-indent-data:t
104+
indent-tabs-mode:nil
105+
sgml-parent-document:nil
106+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
107+
sgml-exposed-tags:nil
108+
sgml-local-catalogs:nil
109+
sgml-local-ecat-files:nil
110+
End:
111+
vim600: syn=xml fen fdm=syntax fdl=2 si
112+
vim: et tw=78 syn=sgml
113+
vi: ts=1 sw=1
114+
-->
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<refentry xml:id="xmlreader.fromstring" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
4+
<refnamediv>
5+
<refname>XMLReader::fromString</refname>
6+
<refpurpose>Creates an <classname>XMLReader</classname> from an XML string</refpurpose>
7+
</refnamediv>
8+
9+
<refsect1 role="description">
10+
&reftitle.description;
11+
<methodsynopsis role="XMLReader">
12+
<modifier>public</modifier> <modifier>static</modifier> <type>static</type><methodname>XMLReader::fromString</methodname>
13+
<methodparam><type>string</type><parameter>source</parameter></methodparam>
14+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
15+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
16+
</methodsynopsis>
17+
<simpara>
18+
Creates an <classname>XMLReader</classname> from an XML string.
19+
</simpara>
20+
</refsect1>
21+
22+
<refsect1 role="parameters">
23+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('xmlreader.xml')/db:refsect1[@role='parameters']/*)">
24+
<xi:fallback/>
25+
</xi:include>
26+
</refsect1>
27+
28+
<refsect1 role="returnvalues">
29+
&reftitle.returnvalues;
30+
<simpara>
31+
Returns an <classname>XMLReader</classname>.
32+
</simpara>
33+
</refsect1>
34+
35+
<refsect1 role="errors">
36+
&reftitle.errors;
37+
<itemizedlist>
38+
<listitem>
39+
<simpara>
40+
Passing an invalid <parameter>encoding</parameter> will throw a
41+
<exceptionname>ValueError</exceptionname>.
42+
</simpara>
43+
</listitem>
44+
</itemizedlist>
45+
</refsect1>
46+
47+
<refsect1 role="seealso">
48+
&reftitle.seealso;
49+
<simplelist>
50+
<member><methodname>XMLReader::fromStream</methodname></member>
51+
<member><methodname>XMLReader::fromUri</methodname></member>
52+
</simplelist>
53+
</refsect1>
54+
</refentry>
55+
<!-- Keep this comment at the end of the file
56+
Local variables:
57+
mode: sgml
58+
sgml-omittag:t
59+
sgml-shorttag:t
60+
sgml-minimize-attributes:nil
61+
sgml-always-quote-attributes:t
62+
sgml-indent-step:1
63+
sgml-indent-data:t
64+
indent-tabs-mode:nil
65+
sgml-parent-document:nil
66+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
67+
sgml-exposed-tags:nil
68+
sgml-local-catalogs:nil
69+
sgml-local-ecat-files:nil
70+
End:
71+
vim600: syn=xml fen fdm=syntax fdl=2 si
72+
vim: et tw=78 syn=sgml
73+
vi: ts=1 sw=1
74+
-->
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<refentry xml:id="xmlreader.fromuri" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
4+
<refnamediv>
5+
<refname>XMLReader::fromUri</refname>
6+
<refpurpose>Creates an <classname>XMLReader</classname> from a URI to read from</refpurpose>
7+
</refnamediv>
8+
9+
<refsect1 role="description">
10+
&reftitle.description;
11+
<methodsynopsis role="XMLReader">
12+
<modifier>public</modifier> <modifier>static</modifier> <type>static</type><methodname>XMLReader::fromUri</methodname>
13+
<methodparam><type>string</type><parameter>uri</parameter></methodparam>
14+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
15+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
16+
</methodsynopsis>
17+
<simpara>
18+
Creates an <classname>XMLReader</classname> from a URI to read from.
19+
</simpara>
20+
</refsect1>
21+
22+
<refsect1 role="parameters">
23+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('xmlreader.open')/db:refsect1[@role='parameters']/*)">
24+
<xi:fallback/>
25+
</xi:include>
26+
</refsect1>
27+
28+
<refsect1 role="returnvalues">
29+
&reftitle.returnvalues;
30+
<simpara>
31+
Returns an <classname>XMLReader</classname>.
32+
</simpara>
33+
</refsect1>
34+
35+
<refsect1 role="errors">
36+
&reftitle.errors;
37+
<itemizedlist>
38+
<listitem>
39+
<simpara>
40+
Passing an invalid <parameter>encoding</parameter> will throw a
41+
<exceptionname>ValueError</exceptionname>.
42+
</simpara>
43+
</listitem>
44+
</itemizedlist>
45+
</refsect1>
46+
47+
<refsect1 role="seealso">
48+
&reftitle.seealso;
49+
<simplelist>
50+
<member><methodname>XMLReader::fromStream</methodname></member>
51+
<member><methodname>XMLReader::fromString</methodname></member>
52+
</simplelist>
53+
</refsect1>
54+
</refentry>
55+
<!-- Keep this comment at the end of the file
56+
Local variables:
57+
mode: sgml
58+
sgml-omittag:t
59+
sgml-shorttag:t
60+
sgml-minimize-attributes:nil
61+
sgml-always-quote-attributes:t
62+
sgml-indent-step:1
63+
sgml-indent-data:t
64+
indent-tabs-mode:nil
65+
sgml-parent-document:nil
66+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
67+
sgml-exposed-tags:nil
68+
sgml-local-catalogs:nil
69+
sgml-local-ecat-files:nil
70+
End:
71+
vim600: syn=xml fen fdm=syntax fdl=2 si
72+
vim: et tw=78 syn=sgml
73+
vi: ts=1 sw=1
74+
-->

0 commit comments

Comments
 (0)