cvs: pear(MAINT_1_2) /Net_NNTP/NNTP Client.php
| From: | Heino H. Gehlsen | Date: | Sun, 13 Mar 2005 17:56:55 +0000 |
| Subject: | cvs: pear(MAINT_1_2) /Net_NNTP/NNTP Client.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-30249@lists.php.net to get a copy of this message | ||
heino Sun Mar 13 12:56:55 2005 EDT
Modified files: (Branch: MAINT_1_2)
/pear/Net_NNTP/NNTP Client.php
Log:
add selectArticle(), selectNextArticle() and selectPreviousArticle()
http://cvs.php.net/diff.php/pear/Net_NNTP/NNTP/Client.php?r1=1.5&r2=1.5.2.1&ty=u
Index: pear/Net_NNTP/NNTP/Client.php
diff -u pear/Net_NNTP/NNTP/Client.php:1.5 pear/Net_NNTP/NNTP/Client.php:1.5.2.1
--- pear/Net_NNTP/NNTP/Client.php:1.5 Fri Jan 14 15:01:00 2005
+++ pear/Net_NNTP/NNTP/Client.php Sun Mar 13 12:56:54 2005
@@ -58,7 +58,7 @@
// | been changes or removed. |
// | |
// +-----------------------------------------------------------------------+
-// $Id: Client.php,v 1.5 2005/01/14 20:01:00 heino Exp $
+// $Id: Client.php,v 1.5.2.1 2005/03/13 17:56:54 heino Exp $
require_once 'Net/NNTP/Protocol/Client.php';
require_once 'Net/NNTP/Header.php';
@@ -83,7 +83,7 @@
* @category Net
* @package Net_NNTP
* @author Heino H. Gehlsen <heino@gehlsen.dk>
- * @version $Id: Client.php,v 1.5 2005/01/14 20:01:00 heino Exp $
+ * @version $Id: Client.php,v 1.5.2.1 2005/03/13 17:56:54 heino Exp $
* @access public
* @see Net_NNTP_Protocol_Client
* @since Class available since Release 0.11.0
@@ -412,6 +412,83 @@
}
// }}}
+ // {{{ selectArticle()
+
+ /**
+ * Selects article
+ *
+ * @param int $article The message-number on the server of the article to fetch.
+ *
+ * @return mixed (???) ??? or (object) pear_error on failure
+ * @access public
+ * @see Net_NNTP_Client::lastArticle()
+ */
+ function selectArticle($article)
+ {
+ $response_arr = $this->cmdStat($article);
+
+ if (PEAR::isError($response_arr)) {
+ return $response_arr;
+ }
+
+ return $response_arr;
+ }
+
+ // }}}
+ // {{{ selectNextArticle()
+
+ /**
+ * Selects next article
+ *
+ * @return mixed (???) ??? or (object) pear_error on failure
+ * @access public
+ * @see Net_NNTP_Client::lastArticle()
+ */
+ function selectNextArticle()
+ {
+ $response_arr = $this->cmdNext();
+
+ if (PEAR::isError($response_arr)) {
+ switch ($response_arr->getCode()) {
+ case 421:
+ return false;
+ break;
+ default:
+ return $response_arr;
+ }
+ }
+
+ return $response_arr;
+ }
+
+ // }}}
+ // {{{ selectPreviousArticle()
+
+ /**
+ * Selects previous article
+ *
+ * @return mixed (???) ??? or (object) pear_error on failure
+ * @access public
+ * @see Net_NNTP_Client::lastArticle()
+ */
+ function selectPreviousArticle()
+ {
+ $response_arr = $this->cmdLast();
+
+ if (PEAR::isError($response_arr)) {
+ switch ($response_arr->getCode()) {
+ case 422:
+ return false;
+ break;
+ default:
+ return $response_arr;
+ }
+ }
+
+ return $response_arr;
+ }
+
+ // }}}
// {{{ getArticle()
/**