mg Wed Aug 18 17:00:46 2004 EDT
Modified files:
/phpdoc/en/reference/tcpwrap/functions tcpwrap-check.xml
Log:
Add example.
http://cvs.php.net/diff.php/phpdoc/en/reference/tcpwrap/functions/tcpwrap-check.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc/en/reference/tcpwrap/functions/tcpwrap-check.xml
diff -u phpdoc/en/reference/tcpwrap/functions/tcpwrap-check.xml:1.1
phpdoc/en/reference/tcpwrap/functions/tcpwrap-check.xml:1.2
--- phpdoc/en/reference/tcpwrap/functions/tcpwrap-check.xml:1.1 Mon Feb 9 07:00:11
2004
+++ phpdoc/en/reference/tcpwrap/functions/tcpwrap-check.xml Wed Aug 18 17:00:46
2004
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
<refentry id="function.tcpwrap-check">
<refnamediv>
@@ -37,6 +37,32 @@
<para>
This function returns &true; if access should be granted, &false; otherwise.
</para>
+ <example>
+ <title><function>tcpwrap_check</function> example</title>
+ <para>
+ If your /etc/hosts.deny file contains:
+ </para>
+ <screen>
+<![CDATA[
+php: 127.0.0.1
+]]>
+ </screen>
+ <para>
+ And your code looks like:
+ </para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+if (!tcpwrap_check('php', $_SERVER['REMOTE_ADDR'])) {
+ die('You are not welcome here');
+}
+?>
+]]>
+ </programlisting>
+ <para>
+ Then above code will deny all connections from localhost.
+ </para>
+ </example>
</refsect1>
</refentry>