Skip to content

Commit bdeed8b

Browse files
TimWollaclaudepache
authored andcommitted
Bootstrap ext/random docs with docgen
Closes phpGH-1916.
1 parent 0d93870 commit bdeed8b

Some content is hidden

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

60 files changed

+3376
-123
lines changed

appendices/extensions.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<listitem><simpara><xref linkend="book.cmark"/></simpara></listitem>
2222
<listitem><simpara><xref linkend="book.com"/></simpara></listitem>
2323
<listitem><simpara><xref linkend="book.componere"/></simpara></listitem>
24-
<listitem><simpara><xref linkend="book.csprng"/></simpara></listitem>
2524
<listitem><simpara><xref linkend="book.ctype"/></simpara></listitem>
2625
<listitem><simpara><xref linkend="book.cubrid"/></simpara></listitem>
2726
<listitem><simpara><xref linkend="book.curl"/></simpara></listitem>
@@ -121,6 +120,7 @@
121120
<listitem><simpara><xref linkend="book.pthreads"/></simpara></listitem>
122121
<listitem><simpara><xref linkend="book.quickhash"/></simpara></listitem>
123122
<listitem><simpara><xref linkend="book.radius"/></simpara></listitem>
123+
<listitem><simpara><xref linkend="book.random"/></simpara></listitem>
124124
<listitem><simpara><xref linkend="book.rar"/></simpara></listitem>
125125
<listitem><simpara><xref linkend="book.readline"/></simpara></listitem>
126126
<listitem><simpara><xref linkend="book.recode"/></simpara></listitem>
@@ -202,7 +202,6 @@
202202
<itemizedlist>
203203
<listitem><para><xref linkend="book.array"/></para></listitem>
204204
<listitem><para><xref linkend="book.classobj"/></para></listitem>
205-
<listitem><para><xref linkend="book.csprng"/></para></listitem>
206205
<listitem><para><xref linkend="book.datetime"/></para></listitem>
207206
<listitem><para><xref linkend="book.dir"/></para></listitem>
208207
<listitem><para><xref linkend="book.errorfunc"/></para></listitem>
@@ -221,6 +220,7 @@
221220
<listitem><para><xref linkend="book.outcontrol"/></para></listitem>
222221
<listitem><para><xref linkend="book.password"/></para></listitem>
223222
<listitem><para><xref linkend="book.pcre"/></para></listitem>
223+
<listitem><para><xref linkend="book.random"/></para></listitem>
224224
<listitem><para><xref linkend="book.reflection"/></para></listitem>
225225
<listitem><para><xref linkend="book.spl"/></para></listitem>
226226
<listitem><para><xref linkend="book.stream"/></para></listitem>

appendices/migration70/new-features.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ session_start([
640640
</sect2>
641641

642642
<sect2 xml:id="migration70.new-features.csprng-functions">
643-
<title><link linkend="book.csprng">CSPRNG</link> Functions</title>
643+
<title>CSPRNG Functions</title>
644644

645645
<para>
646646
Two new functions have been added to generate cryptographically secure

appendices/migration70/new-functions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</sect2>
1818

1919
<sect2 xml:id="migration70.new-functions.csprng">
20-
<title><link linkend="book.csprng">CSPRNG</link></title>
20+
<title>CSPRNG</title>
2121

2222
<itemizedlist>
2323
<listitem>

reference/csprng/book.xml

Lines changed: 0 additions & 48 deletions
This file was deleted.

reference/csprng/constants.xml

Lines changed: 0 additions & 29 deletions
This file was deleted.

reference/math/versions.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,24 @@
2626
<function name="fdiv" from="PHP 8"/>
2727
<function name="floor" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
2828
<function name="fmod" from="PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8"/>
29-
<function name="getrandmax" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
3029
<function name="hexdec" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
3130
<function name="hypot" from="PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8"/>
3231
<function name="is_finite" from="PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8"/>
3332
<function name="is_infinite" from="PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8"/>
3433
<function name="is_nan" from="PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8"/>
35-
<function name="lcg_value" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
3634
<function name="log" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
3735
<function name="log10" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
3836
<function name="log1p" from="PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8"/>
3937
<function name="max" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
4038
<function name="min" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
41-
<function name="mt_getrandmax" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
42-
<function name="mt_rand" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
43-
<function name="mt_srand" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
4439
<function name="octdec" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
4540
<function name="pi" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
4641
<function name="pow" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
4742
<function name="rad2deg" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
48-
<function name="rand" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
4943
<function name="round" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
5044
<function name="sin" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
5145
<function name="sinh" from="PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8"/>
5246
<function name="sqrt" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
53-
<function name="srand" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
5447
<function name="tan" from="PHP 4, PHP 5, PHP 7, PHP 8"/>
5548
<function name="tanh" from="PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8"/>
5649
<function name="intdiv" from="PHP 7, PHP 8"/>

reference/random/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.random" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<?phpdoc extension-membership="core" ?>
4+
<title>Random Number Generators and Functions Related to Randomness</title>
5+
<titleabbrev>random</titleabbrev>
6+
7+
<preface xml:id="intro.random">
8+
&reftitle.intro;
9+
<para>
10+
11+
</para>
12+
</preface>
13+
14+
&reference.random.setup;
15+
&reference.random.constants;
16+
&reference.random.examples;
17+
&reference.random.reference;
18+
19+
&reference.random.random.randomizer;
20+
21+
&reference.random.random.engine;
22+
&reference.random.random.engine.mt19937;
23+
&reference.random.random.engine.pcgoneseq128xslrr64;
24+
&reference.random.random.engine.xoshiro256starstar;
25+
&reference.random.random.cryptosafeengine;
26+
&reference.random.random.engine.secure;
27+
28+
&reference.random.random.randomerror;
29+
&reference.random.random.brokenrandomengineerror;
30+
&reference.random.random.randomexception;
31+
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+
-->

reference/random/constants.xml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<appendix xml:id="random.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
&reftitle.constants;
4+
&extension.constants.core;
5+
<para>
6+
<variablelist>
7+
<varlistentry xml:id="constant.mt-rand-mt19937">
8+
<term>
9+
<constant>MT_RAND_MT19937</constant>
10+
(<type>integer</type>)
11+
</term>
12+
<listitem>
13+
<simpara>
14+
</simpara>
15+
</listitem>
16+
</varlistentry>
17+
<varlistentry xml:id="constant.mt-rand-php">
18+
<term>
19+
<constant>MT_RAND_PHP</constant>
20+
(<type>integer</type>)
21+
</term>
22+
<listitem>
23+
<simpara>
24+
</simpara>
25+
</listitem>
26+
</varlistentry>
27+
</variablelist>
28+
</para>
29+
</appendix>
30+
<!-- Keep this comment at the end of the file
31+
Local variables:
32+
mode: sgml
33+
sgml-omittag:t
34+
sgml-shorttag:t
35+
sgml-minimize-attributes:nil
36+
sgml-always-quote-attributes:t
37+
sgml-indent-step:1
38+
sgml-indent-data:t
39+
indent-tabs-mode:nil
40+
sgml-parent-document:nil
41+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
42+
sgml-exposed-tags:nil
43+
sgml-local-catalogs:nil
44+
sgml-local-ecat-files:nil
45+
End:
46+
vim600: syn=xml fen fdm=syntax fdl=2 si
47+
vim: et tw=78 syn=sgml
48+
vi: ts=1 sw=1
49+
-->

reference/csprng/versions.xml renamed to reference/random/examples.xml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- $Revision$ -->
3-
<!--
4-
Do NOT translate this file
5-
-->
2+
<chapter xml:id="random.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
&reftitle.examples;
4+
<example>
5+
<title>Random Example</title>
6+
<programlisting role="php">
7+
<![CDATA[
8+
<?php
69
7-
<versions>
8-
<function name="random_bytes" from="PHP 7, PHP 8"/>
9-
<function name="random_int" from="PHP 7, PHP 8"/>
10-
</versions>
10+
/* ... */
1111
12+
?>
13+
]]>
14+
</programlisting>
15+
&example.outputs.similar;
16+
<screen>
17+
<![CDATA[
18+
...
19+
]]>
20+
</screen>
21+
</example>
22+
</chapter>
1223
<!-- Keep this comment at the end of the file
1324
Local variables:
1425
mode: sgml

reference/math/functions/getrandmax.xml renamed to reference/random/functions/getrandmax.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
&reftitle.parameters;
2222
&no.function.parameters;
2323
</refsect1>
24-
24+
2525
<refsect1 role="returnvalues">
2626
&reftitle.returnvalues;
2727
<para>

0 commit comments

Comments
 (0)