php-doc-en/reference/crack/examples.xml
Torben Wilson af4410a7e1 Normalized the sgml-default-dtd-file local-variable line for those
still using this, after discussion on the phpdoc list.
From now on, manual.ced will need to be found at ~/.phpdoc/manual.ced.



git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@288721 c90b9560-bf6c-de11-be94-00142212c4b1
2009-09-25 07:04:39 +00:00

61 lines
1.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<appendix xml:id="crack.examples">
&reftitle.examples;
<para>
This example shows how to open a CrackLib dictionary, test a given
password, retrieve any diagnostic messages, and close the dictionary.
<example>
<title>CrackLib example</title>
<programlisting role="php">
<![CDATA[
<?php
// Open CrackLib Dictionary
$dictionary = crack_opendict('/usr/local/lib/pw_dict')
or die('Unable to open CrackLib dictionary');
// Perform password check
$check = crack_check($dictionary, 'gx9A2s0x');
// Retrieve messages
$diag = crack_getlastmessage();
echo $diag; // 'strong password'
// Close dictionary
crack_closedict($dictionary);
?>
]]>
</programlisting>
</example>
</para>
<note>
<para>
If <function>crack_check</function> returns &true;,
<function>crack_getlastmessage</function> will return
<literal>'strong password'</literal>.
</para>
</note>
</appendix>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->