svn: /phpdoc/en/trunk/ language-snippets.ent reference/csprng/functions/random-bytes.xml reference/csprng/functions/random-int.xml

From: Date: Fri, 02 Oct 2015 21:09:01 +0000
Subject: svn: /phpdoc/en/trunk/ language-snippets.ent reference/csprng/functions/random-bytes.xml reference/csprng/functions/random-int.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-13770@lists.php.net to get a copy of this message
sammyk Fri, 02 Oct 2015 21:09:01 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=337941 Log: Update CSPRNG docs to reflect proper exceptions being thrown Changed paths: U phpdoc/en/trunk/language-snippets.ent U phpdoc/en/trunk/reference/csprng/functions/random-bytes.xml U phpdoc/en/trunk/reference/csprng/functions/random-int.xml Modified: phpdoc/en/trunk/language-snippets.ent =================================================================== --- phpdoc/en/trunk/language-snippets.ent 2015-10-02 21:08:01 UTC (rev 337940) +++ phpdoc/en/trunk/language-snippets.ent 2015-10-02 21:09:01 UTC (rev 337941) @@ -2137,8 +2137,8 @@ <itemizedlist xmlns="http://docbook.org/ns/docbook"> <listitem> <simpara> - <!-- TODO: link this to an MSDN link or similar --> - On Windows, <function>CryptGenRandom</function> will always be used. + On Windows, <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&url.csprng.crypt-gen-random;"> + <function>CryptGenRandom</function></link> will always be used. </simpara> </listitem> <listitem> @@ -2150,25 +2150,41 @@ </listitem> <listitem> <simpara> - Failing the above, <filename>/dev/arandom</filename> will be used if - available. + Failing the above, a Linux + <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&url.csprng.get-random-2;">getrandom(2)</link> + syscall will be used if available. </simpara> </listitem> <listitem> <simpara> - If <filename>/dev/arandom</filename> is unavailable, then - <filename>/dev/urandom</filename> will be used as the final fallback. + If all else fails <filename>/dev/urandom</filename> will be used as the + final fallback. </simpara> </listitem> <listitem> <simpara> If none of the aforementioned sources are available, then an - <classname>Error</classname> will be thrown. + <classname>Exception</classname> will be thrown. </simpara> </listitem> </itemizedlist> '> +<!ENTITY csprng.errors ' + <listitem xmlns="http://docbook.org/ns/docbook"> + <simpara> + If an appropriate source of randomness cannot be found, + an <classname>Exception</classname> will be thrown. + </simpara> + </listitem> + <listitem xmlns="http://docbook.org/ns/docbook"> + <simpara> + If invalid parameters are given, a <classname>TypeError</classname> + will be thrown. + </simpara> + </listitem> +'> + <!-- Migration Guide snippets --> <!ENTITY migration56.openssl.peer-verification ' <para xmlns="http://docbook.org/ns/docbook"> Modified: phpdoc/en/trunk/reference/csprng/functions/random-bytes.xml =================================================================== --- phpdoc/en/trunk/reference/csprng/functions/random-bytes.xml 2015-10-02 21:08:01 UTC (rev 337940) +++ phpdoc/en/trunk/reference/csprng/functions/random-bytes.xml 2015-10-02 21:09:01 UTC (rev 337941) @@ -45,10 +45,15 @@ <refsect1 role="errors"><!-- {{{ --> &reftitle.errors; - <para> - If an appropriate source of randomness cannot be found or an invalid number - of bytes is given, an <classname>Error</classname> will be thrown. - </para> + <itemizedlist> + &csprng.errors; + <listitem> + <simpara> + If an invalid <parameter>length</parameter> of bytes is given, an + <classname>Error</classname> will be thrown. + </simpara> + </listitem> + </itemizedlist> </refsect1><!-- }}} --> <refsect1 role="examples"><!-- {{{ --> Modified: phpdoc/en/trunk/reference/csprng/functions/random-int.xml =================================================================== --- phpdoc/en/trunk/reference/csprng/functions/random-int.xml 2015-10-02 21:08:01 UTC (rev 337940) +++ phpdoc/en/trunk/reference/csprng/functions/random-int.xml 2015-10-02 21:09:01 UTC (rev 337941) @@ -56,11 +56,15 @@ <refsect1 role="errors"><!-- {{{ --> &reftitle.errors; - <para> - If an appropriate source of randomness cannot be found, invalid parameters - are given, or <parameter>max</parameter> is less than - <parameter>min</parameter>, an <classname>Error</classname> will be thrown. - </para> + <itemizedlist> + &csprng.errors; + <listitem> + <simpara> + If <parameter>max</parameter> is less than <parameter>min</parameter>, an + <classname>Error</classname> will be thrown. + </simpara> + </listitem> + </itemizedlist> </refsect1><!-- }}} --> <refsect1 role="examples"><!-- {{{ -->

« previous php.doc.cvs (#13770) next »