cvs: phpdoc /en/reference/imap/functions imap-ping.xml

From: Date: Fri, 03 Sep 2004 18:43:59 +0000
Subject: cvs: phpdoc /en/reference/imap/functions imap-ping.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969363783@lists.php.net to get a copy of this message
didou Fri Sep 3 14:43:59 2004 EDT Modified files: /phpdoc/en/reference/imap/functions imap-ping.xml Log: WS and typos, removed the author feelings about the function as I just used it for a deamon and it _was_ handy also added a basic example http://cvs.php.net/diff.php/phpdoc/en/reference/imap/functions/imap-ping.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/imap/functions/imap-ping.xml diff -u phpdoc/en/reference/imap/functions/imap-ping.xml:1.4 phpdoc/en/reference/imap/functions/imap-ping.xml:1.5 --- phpdoc/en/reference/imap/functions/imap-ping.xml:1.4 Thu Oct 2 12:05:15 2003 +++ phpdoc/en/reference/imap/functions/imap-ping.xml Fri Sep 3 14:43:59 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/imap.xml, last change in rev 1.2 --> <refentry id="function.imap-ping"> <refnamediv> @@ -16,12 +16,29 @@ Returns &true; if the stream is still alive, &false; otherwise. </para> <para> - <function>imap_ping</function> function pings the stream to see - it is still active. It may discover new mail; this is the - preferred method for a periodic "new mail check" as well as a - "keep alive" for servers which have inactivity timeout. - (As PHP scripts do not tend to run that long, I can hardly - imagine that this function will be useful to anyone.) + <function>imap_ping</function> pings the stream to see if it's still + active. It may discover new mail; this is the preferred method for a + periodic "new mail check" as well as a "keep alive" for servers which + have inactivity timeout. + </para> + <para> + <example> + <title><function>imap_ping</function> Example</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$imap = imap_open("{your.imap.host}", "mailadmin", "password"); + +// after some sleeping +if (!imap_ping($imap)) { + // do some stuff to reconnect +} + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry>

« previous php.doc (#969363783) next »