Skip to content

Commit 4e6f077

Browse files
authored
Generate a few ext/standard method synopses from stubs (#1013)
1 parent b05a34e commit 4e6f077

File tree

6 files changed

+89
-35
lines changed

6 files changed

+89
-35
lines changed

reference/info/functions/ini-get-all.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<refsect1 role="description">
1010
&reftitle.description;
1111
<methodsynopsis>
12-
<type>array</type><methodname>ini_get_all</methodname>
12+
<type class="union"><type>array</type><type>false</type></type><methodname>ini_get_all</methodname>
1313
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>extension</parameter><initializer>&null;</initializer></methodparam>
1414
<methodparam choice="opt"><type>bool</type><parameter>details</parameter><initializer>&true;</initializer></methodparam>
1515
</methodsynopsis>
@@ -173,7 +173,7 @@ Array
173173
&reftitle.seealso;
174174
<para>
175175
<simplelist>
176-
<member><xref linkend="configuration.changes" /></member>
176+
<member><xref linkend="configuration.changes"/></member>
177177
<member><function>ini_get</function></member>
178178
<member><function>ini_restore</function></member>
179179
<member><function>ini_set</function></member>
@@ -185,7 +185,6 @@ Array
185185
</refsect1>
186186

187187
</refentry>
188-
189188
<!-- Keep this comment at the end of the file
190189
Local variables:
191190
mode: sgml

reference/info/functions/phpversion.xml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<refsect1 role="description">
1010
&reftitle.description;
1111
<methodsynopsis>
12-
<type>string</type><methodname>phpversion</methodname>
13-
<methodparam choice="opt"><type>string</type><parameter>extension</parameter></methodparam>
12+
<type class="union"><type>string</type><type>false</type></type><methodname>phpversion</methodname>
13+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>extension</parameter><initializer>&null;</initializer></methodparam>
1414
</methodsynopsis>
1515
<para>
1616
Returns a string containing the version of the currently running PHP
@@ -37,13 +37,36 @@
3737
<refsect1 role="returnvalues">
3838
&reftitle.returnvalues;
3939
<para>
40-
If the optional <parameter>extension</parameter> parameter is
41-
specified, <function>phpversion</function> returns the version of that
42-
extension, or &false; if there is no version information associated or
43-
the extension isn't enabled.
40+
Returns the current PHP version as a <type>string</type>.
41+
If a <type>string</type> argument is provided for
42+
<parameter>extension</parameter> parameter, <function>phpversion</function>
43+
returns the version of that extension, or &false; if there is no version
44+
information associated or the extension isn't enabled.
4445
</para>
4546
</refsect1>
4647

48+
<refsect1 role="changelog">
49+
&reftitle.changelog;
50+
<informaltable>
51+
<tgroup cols="2">
52+
<thead>
53+
<row>
54+
<entry>&Version;</entry>
55+
<entry>&Description;</entry>
56+
</row>
57+
</thead>
58+
<tbody>
59+
<row>
60+
<entry>8.0.0</entry>
61+
<entry>
62+
<parameter>extension</parameter> is nullable now.
63+
</entry>
64+
</row>
65+
</tbody>
66+
</tgroup>
67+
</informaltable>
68+
</refsect1>
69+
4770
<refsect1 role="examples">
4871
&reftitle.examples;
4972
<para>
@@ -129,7 +152,6 @@ if (PHP_VERSION_ID < 50207) {
129152
</refsect1>
130153

131154
</refentry>
132-
133155
<!-- Keep this comment at the end of the file
134156
Local variables:
135157
mode: sgml

reference/info/functions/version-compare.xml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@
99
<refsect1 role="description">
1010
&reftitle.description;
1111
<methodsynopsis>
12-
<type>int</type><methodname>version_compare</methodname>
12+
<type class="union"><type>int</type><type>bool</type></type><methodname>version_compare</methodname>
1313
<methodparam><type>string</type><parameter>version1</parameter></methodparam>
1414
<methodparam><type>string</type><parameter>version2</parameter></methodparam>
15-
</methodsynopsis>
16-
<methodsynopsis>
17-
<type>bool</type><methodname>version_compare</methodname>
18-
<methodparam><type>string</type><parameter>version1</parameter></methodparam>
19-
<methodparam><type>string</type><parameter>version2</parameter></methodparam>
20-
<methodparam><type>string</type><parameter>operator</parameter></methodparam>
15+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>operator</parameter><initializer>&null;</initializer></methodparam>
2116
</methodsynopsis>
2217
<para>
2318
<function>version_compare</function> compares two "PHP-standardized"
@@ -65,14 +60,13 @@
6560
<term><parameter>operator</parameter></term>
6661
<listitem>
6762
<para>
68-
If the third optional <parameter>operator</parameter> argument is
69-
specified, test for a particular relationship. The possible operators
63+
An optional operator. The possible operators
7064
are: <literal>&lt;</literal>, <literal>lt</literal>,
7165
<literal>&lt;=</literal>, <literal>le</literal>, <literal>&gt;</literal>,
7266
<literal>gt</literal>, <literal>&gt;=</literal>, <literal>ge</literal>,
7367
<literal>==</literal>, <literal>=</literal>, <literal>eq</literal>,
7468
<literal>!=</literal>, <literal>&lt;&gt;</literal>, <literal>ne</literal>
75-
respectively.
69+
respectively.
7670
</para>
7771
<para>
7872
This parameter is case-sensitive, values should be lowercase.
@@ -87,15 +81,14 @@
8781
&reftitle.returnvalues;
8882
<para>
8983
By default, <function>version_compare</function> returns
90-
<literal>-1</literal> if the first version is lower than the second,
84+
<literal>-1</literal> if the first version is lower than the second,
9185
<literal>0</literal> if they are equal, and
92-
<literal>1</literal> if the second is lower.
86+
<literal>1</literal> if the second is lower.
9387
</para>
9488
<para>
9589
When using the optional <parameter>operator</parameter> argument, the
9690
function will return &true; if the relationship is the one specified
9791
by the operator, &false; otherwise.
98-
If an unsupported <parameter>operator</parameter> is given, &null; is returned.
9992
</para>
10093
</refsect1>
10194

@@ -170,7 +163,6 @@ if (version_compare(PHP_VERSION, '5.0.0', '<')) {
170163
</refsect1>
171164

172165
</refentry>
173-
174166
<!-- Keep this comment at the end of the file
175167
Local variables:
176168
mode: sgml

reference/network/functions/fsockopen.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,13 @@
9090
<term><parameter>timeout</parameter></term>
9191
<listitem>
9292
<para>
93-
The connection timeout, in seconds.
93+
The connection timeout, in seconds. When &null;, the
94+
<link linkend="ini.default-socket-timeout">default_socket_timeout</link> &php.ini; setting is used.
9495
</para>
9596
<note>
9697
<para>
9798
If you need to set a timeout for reading/writing data over the
98-
socket, use <function>stream_set_timeout</function>, as the
99+
socket, use <function>stream_set_timeout</function>, as the
99100
<parameter>timeout</parameter> parameter to
100101
<function>fsockopen</function> only applies while connecting the
101102
socket.

reference/network/functions/header-remove.xml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
43
<refentry xml:id="function.header-remove" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
54
<refnamediv>
65
<refname>header_remove</refname>
@@ -11,7 +10,7 @@
1110
&reftitle.description;
1211
<methodsynopsis>
1312
<type>void</type><methodname>header_remove</methodname>
14-
<methodparam choice="opt"><type>string</type><parameter>name</parameter></methodparam>
13+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>name</parameter><initializer>&null;</initializer></methodparam>
1514
</methodsynopsis>
1615
<para>
1716
Removes an HTTP header previously set using <function>header</function>.
@@ -26,7 +25,7 @@
2625
<term><parameter>name</parameter></term>
2726
<listitem>
2827
<para>
29-
The header name to be removed.
28+
The header name to be removed. When &null;, all previously set headers are removed.
3029
</para>
3130
<note>
3231
<simpara>
@@ -46,6 +45,28 @@
4645
</para>
4746
</refsect1>
4847

48+
<refsect1 role="changelog">
49+
&reftitle.changelog;
50+
<informaltable>
51+
<tgroup cols="2">
52+
<thead>
53+
<row>
54+
<entry>&Version;</entry>
55+
<entry>&Description;</entry>
56+
</row>
57+
</thead>
58+
<tbody>
59+
<row>
60+
<entry>8.0.0</entry>
61+
<entry>
62+
<parameter>name</parameter> is nullable now.
63+
</entry>
64+
</row>
65+
</tbody>
66+
</tgroup>
67+
</informaltable>
68+
</refsect1>
69+
4970
<refsect1 role="examples">
5071
&reftitle.examples;
5172
<para>
@@ -109,7 +130,6 @@ header_remove();
109130
</refsect1>
110131

111132
</refentry>
112-
113133
<!-- Keep this comment at the end of the file
114134
Local variables:
115135
mode: sgml
@@ -130,4 +150,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
130150
vim: et tw=78 syn=sgml
131151
vi: ts=1 sw=1
132152
-->
133-

reference/network/functions/pfsockopen.xml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<type class="union"><type>resource</type><type>false</type></type><methodname>pfsockopen</methodname>
1313
<methodparam><type>string</type><parameter>hostname</parameter></methodparam>
1414
<methodparam choice="opt"><type>int</type><parameter>port</parameter><initializer>-1</initializer></methodparam>
15-
<methodparam choice="opt"><type>int</type><parameter role="reference">errno</parameter></methodparam>
16-
<methodparam choice="opt"><type>string</type><parameter role="reference">errstr</parameter></methodparam>
17-
<methodparam choice="opt"><type>float</type><parameter>timeout</parameter><initializer>ini_get("default_socket_timeout")</initializer></methodparam>
15+
<methodparam choice="opt"><type>int</type><parameter role="reference">error_code</parameter><initializer>&null;</initializer></methodparam>
16+
<methodparam choice="opt"><type>string</type><parameter role="reference">error_message</parameter><initializer>&null;</initializer></methodparam>
17+
<methodparam choice="opt"><type class="union"><type>float</type><type>null</type></type><parameter>timeout</parameter><initializer>&null;</initializer></methodparam>
1818
</methodsynopsis>
1919
<para>
2020
This function behaves exactly as <function>fsockopen</function> with the
@@ -42,6 +42,28 @@
4242
</para>
4343
</refsect1>
4444

45+
<refsect1 role="changelog">
46+
&reftitle.changelog;
47+
<informaltable>
48+
<tgroup cols="2">
49+
<thead>
50+
<row>
51+
<entry>&Version;</entry>
52+
<entry>&Description;</entry>
53+
</row>
54+
</thead>
55+
<tbody>
56+
<row>
57+
<entry>8.0.0</entry>
58+
<entry>
59+
<parameter>timeout</parameter> is nullable now.
60+
</entry>
61+
</row>
62+
</tbody>
63+
</tgroup>
64+
</informaltable>
65+
</refsect1>
66+
4567
<refsect1 role="seealso">
4668
&reftitle.seealso;
4769
<para>
@@ -52,7 +74,6 @@
5274
</refsect1>
5375

5476
</refentry>
55-
5677
<!-- Keep this comment at the end of the file
5778
Local variables:
5879
mode: sgml

0 commit comments

Comments
 (0)