Net_NNTP
[ class tree: Net_NNTP ] [ index: Net_NNTP ] [ all elements ]

Source for file Client.php

Documentation is available at Client.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
  3. // +-----------------------------------------------------------------------+
  4. // |                                                                       |
  5. // |                  http://www.heino.gehlsen.dk/software/license         |
  6. // |                                                                       |
  7. // +-----------------------------------------------------------------------+
  8. // |                                                                       |
  9. // | This work (including software, documents, or other related items) is  |
  10. // | being provided by the copyright holders under the following license.  |
  11. // | By obtaining, using and/or copying this work, you (the licensee)      |
  12. // | agree that you have read, understood, and will comply with the        |
  13. // | following terms and conditions:                                       |
  14. // |                                                                       |
  15. // | Permission to use, copy, modify, and distribute this software and     |
  16. // | its documentation, with or without modification, for any purpose and  |
  17. // | without fee or royalty is hereby granted, provided that you include   |
  18. // | the following on ALL copies of the software and documentation or      |
  19. // | portions thereof, including modifications, that you make:             |
  20. // |                                                                       |
  21. // | 1. The full text of this NOTICE in a location viewable to users of    |
  22. // |    the redistributed or derivative work.                              |
  23. // |                                                                       |
  24. // | 2. Any pre-existing intellectual property disclaimers, notices, or    |
  25. // |    terms and conditions. If none exist, a short notice of the         |
  26. // |    following form (hypertext is preferred, text is permitted) should  |
  27. // |    be used within the body of any redistributed or derivative code:   |
  28. // |     http://www.heino.gehlsen.dk/software/license"                     |
  29. // |                                                                       |
  30. // | 3. Notice of any changes or modifications to the files, including     |
  31. // |    the date changes were made. (We recommend you provide URIs to      |
  32. // |    the location from which the code is derived.)                      |
  33. // |                                                                       |
  34. // | THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT    |
  35. // | HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,    |
  36. // | INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR        |
  37. // | FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE    |
  38. // | OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,           |
  39. // | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.                               |
  40. // |                                                                       |
  41. // | COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,        |
  42. // | SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE        |
  43. // | SOFTWARE OR DOCUMENTATION.                                            |
  44. // |                                                                       |
  45. // | The name and trademarks of copyright holders may NOT be used in       |
  46. // | advertising or publicity pertaining to the software without specific, |
  47. // | written prior permission. Title to copyright in this software and any |
  48. // | associated documentation will at all times remain with copyright      |
  49. // | holders.                                                              |
  50. // |                                                                       |
  51. // +-----------------------------------------------------------------------+
  52. // |                                                                       |
  53. // | except for the references to the copyright holder, which has either   |
  54. // | been changes or removed.                                              |
  55. // |                                                                       |
  56. // +-----------------------------------------------------------------------+
  57. // $Id: Client.php,v 1.1.4.8 2004/08/21 12:12:13 heino Exp $
  58.  
  59. require_once 'Net/NNTP/Protocol/Client.php';
  60. require_once 'Net/NNTP/Header.php';
  61. require_once 'Net/NNTP/Message.php';
  62.  
  63.  
  64. // {{{ constants
  65.  
  66. /* NNTP Authentication modes */
  67. define('NET_NNTP_CLIENT_AUTH_ORIGINAL''original');
  68. define('NET_NNTP_CLIENT_AUTH_SIMPLE',   'simple');
  69. define('NET_NNTP_CLIENT_AUTH_GENERIC',  'generic');
  70.  
  71. /* Deprecated authentication modes */
  72. define('NET_NNTP_AUTHORIGINAL'NET_NNTP_CLIENT_AUTH_ORIGINAL);
  73. define('NET_NNTP_AUTHSIMPLE',   NET_NNTP_CLIENT_AUTH_SIMPLE);
  74. define('NET_NNTP_AUTHGENERIC',  NET_NNTP_CLIENT_AUTH_GENERIC);
  75.  
  76. // }}}
  77. // {{{ Net_NNTP_Client
  78.  
  79. /**
  80.  * Implementation of the client side of NNTP (Network News Transfer Protocol)
  81.  *
  82.  * The Net_NNTP_Client class is a frontend class to the Net_NNTP_Protocol_Client class.
  83.  *
  84.  * @category   Net
  85.  * @package    Net_NNTP
  86.  * @author     Heino H. Gehlsen <heino@gehlsen.dk>
  87.  * @version    $Id: Client.php,v 1.1.4.8 2004/08/21 12:12:13 heino Exp $
  88.  * @access     public
  89.  * @see        Net_NNTP_Protocol_Client
  90.  * @since      Class available since Release 0.11.0
  91.  */
  92. {
  93.     // {{{ properties
  94.  
  95.     /**
  96.      * Used for storing information about the currently selected group
  97.      *
  98.      * @var array 
  99.      * @access private
  100.      * @since 0.3
  101.      */
  102.     var $_currentGroup = null;
  103.  
  104.     // }}}
  105.     // {{{ constructor
  106.  
  107.     /**
  108.      * Constructor
  109.      *
  110.      * @access public
  111.      */
  112.     function Net_NNTP_Client()
  113.     {
  114.         parent::Net_NNTP_Protocol_Client();
  115.     }
  116.  
  117.     // }}}
  118.     // {{{ connect()
  119.  
  120.     /**
  121.      * Connect to the NNTP-server.
  122.      *
  123.      * @param optional string $host The adress of the NNTP-server to connect to.
  124.      * @param optional int $port The port to connect to.
  125.      *
  126.      * @return mixed (bool) true on success or (object) pear_error on failure
  127.      * @access public
  128.      * @see Net_NNTP_Client::quit()
  129.      * @see Net_NNTP_Client::authenticate()
  130.      * @see Net_NNTP_Client::connectAuthenticated()
  131.      */
  132.     function connect($host = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_HOST,
  133.                      $port = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_PORT)
  134.     {
  135.         return parent::connect($host$port);
  136.     }
  137.  
  138.     // }}}
  139.     // {{{ connectAuthenticated()
  140.  
  141.     /**
  142.      * Connect to the NNTP-server, and authenticate using given username and password.
  143.      *
  144.      * @param optional string $user The username.
  145.      * @param optional string $pass The password.
  146.      * @param optional string $host The IP-address of the NNTP-server to connect to.
  147.      * @param optional int $port The port to connect to.
  148.      * @param optional string $authmode The authentication mode.
  149.      *
  150.      * @return mixed (bool) true on success or (object) pear_error on failure
  151.      * @access public
  152.      * @since 0.3
  153.      * @see Net_NNTP_Client::connect()
  154.      * @see Net_NNTP_Client::authenticate()
  155.      * @see Net_NNTP_Client::quit()
  156.      */
  157.     function connectAuthenticated($user = null,
  158.                                   $pass = null,
  159.                                   $host = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_HOST,
  160.                                   $port = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_PORT,
  161.                                   $authmode = NET_NNTP_CLIENT_AUTH_ORIGINAL)
  162.     {
  163.     $R $this->connect($host$port);
  164.     if (PEAR::isError($R)) {
  165.         return $R;
  166.     }
  167.  
  168.     // Authenticate if username is given
  169.     if ($user != null{
  170.             $R $this->authenticate($user$pass$authmode);
  171.             if (PEAR::isError($R)) {
  172.                 return $R;
  173.             }
  174.     }
  175.  
  176.         return true;
  177.     }
  178.  
  179.     // }}}
  180.     // {{{ quit()
  181.  
  182.     /**
  183.      * Close connection to the newsserver
  184.      *
  185.      * @access public
  186.      * @see Net_NNTP_Client::connect()
  187.      */
  188.     function quit()
  189.     {
  190.         return $this->cmdQuit();
  191.     }
  192.  
  193.     // }}}
  194.     // {{{ authenticate()
  195.  
  196.     /**
  197.      * Authenticate
  198.      * 
  199.      * Auth process (not yet standarized but used any way)
  200.      * http://www.mibsoftware.com/userkt/nntpext/index.html
  201.      *
  202.      * @param string $user The username
  203.      * @param optional string $pass The password
  204.      * @param optional string $mode The authentication mode (original, simple, generic).
  205.      *
  206.      * @return mixed (bool) true on success or (object) pear_error on failure
  207.      * @access public
  208.      * @see Net_NNTP_Client::connect()
  209.      * @see Net_NNTP_Client::connectAuthenticated()
  210.      */
  211.     function authenticate($user$pass$mode = NET_NNTP_CLIENT_AUTH_ORIGINAL)
  212.     {
  213.         // Username is a must...
  214.         if ($user == null{
  215.             return PEAR::throwError('No username supplied'null);
  216.         }
  217.  
  218.         // Use selected authentication method
  219.         switch ($mode{
  220.             case NET_NNTP_CLIENT_AUTH_ORIGINAL:
  221.                 return $this->cmdAuthinfo($user$pass);
  222.                 break;
  223.             case NET_NNTP_CLIENT_AUTH_SIMPLE:
  224.                 return $this->cmdAuthinfoSimple($user$pass);
  225.                 break;
  226.             case NET_NNTP_CLIENT_AUTH_GENERIC:
  227.                 return $this->cmdAuthinfoGeneric($user$pass);
  228.                 break;
  229.             default:
  230.                 return PEAR::throwError("The auth mode: '$mode' is unknown"null);
  231.         }
  232.     }
  233.  
  234.     // }}}
  235.     // {{{ isConnected()
  236.  
  237.     /**
  238.      * Test whether a connection is currently open.
  239.      *
  240.      * @return bool true or false
  241.      * @access public
  242.      * @see Net_NNTP_Client::connect()
  243.      * @see Net_NNTP_Client::quit()
  244.      */
  245.     function isConnected()
  246.     {
  247.         return parent::isConnected();
  248.     }
  249.  
  250.     // }}}
  251.     // {{{ selectGroup()
  252.  
  253.     /**
  254.      * Selects a newsgroup
  255.      *
  256.      * @param string $newsgroup Newsgroup name
  257.      *
  258.      * @return mixed (array) Info about the newsgroup on success or (object) pear_error on failure
  259.      * @access public
  260.      * @see Net_NNTP_Client::group()
  261.      * @see Net_NNTP_Client::first()
  262.      * @see Net_NNTP_Client::last()
  263.      * @see Net_NNTP_Client::count()
  264.      * @see Net_NNTP_Client::getGroups()
  265.      */
  266.     function selectGroup($newsgroup)
  267.     {
  268.         $response_arr $this->cmdGroup($newsgroup);
  269.         if (PEAR::isError($response_arr)) {
  270.             return $response_arr;
  271.         }
  272.  
  273.         // Store group info in the object
  274.         $this->_currentGroup $response_arr;
  275.  
  276.         return $response_arr;
  277.     }
  278.  
  279.     // }}}
  280.     // {{{ getGroups()
  281.  
  282.     /**
  283.      * Fetches a list of all avaible newsgroups
  284.      *
  285.      * @return mixed (array) nested array with informations about existing newsgroups on success or (object) pear_error on failure
  286.      * @access public
  287.      * @see Net_NNTP_Client::selectGroup()
  288.      * @see Net_NNTP_Client::getDescriptions()
  289.      */
  290.     function getGroups()
  291.     {
  292.         // Get groups
  293.         $groups $this->cmdList();
  294.         if (PEAR::isError($groups)) {
  295.             return $groups;
  296.         }
  297.  
  298.         return $groups;
  299.     }
  300.  
  301.     // }}}
  302.     // {{{ getDescriptions()
  303.  
  304.     /**
  305.      * Fetches a list of all avaible newsgroup descriptions.
  306.      *
  307.      * @return mixed (array) nested array with description of existing newsgroups on success or (object) pear_error on failure
  308.      * @access public
  309.      * @see Net_NNTP_Client::getGroups()
  310.      */
  311.     function getDescriptions()
  312.     {
  313.         // Get group descriptions
  314.         $descriptions $this->cmdListNewsgroups();
  315.         if (PEAR::isError($descriptions)) {
  316.             return $descriptions;
  317.         }
  318.     
  319.         return $descriptions;
  320.     }
  321.  
  322.     // }}}
  323.     // {{{ getOverview()
  324.  
  325.     /**
  326.      * Fetch message header fields from message number $first to $last
  327.      *
  328.      * The format of the returned array is:
  329.      * $messages[message_id][header_name]
  330.      *
  331.      * @param integer $first first article to fetch
  332.      * @param integer $last  last article to fetch
  333.      *
  334.      * @return mixed (array) nested array of message and their headers on success or (object) pear_error on failure
  335.      * @access public
  336.      * @see Net_NNTP_Client::getOverviewFormat()
  337.      * @see Net_NNTP_Client::getReferencesOverview()
  338.      */
  339.     function getOverview($first$last)
  340.     {
  341.         $overview $this->cmdXOver($first.'-'.$last);
  342.         if (PEAR::isError($overview)) {
  343.             return $overview;
  344.         }
  345.     
  346.         return $overview;
  347.     }
  348.  
  349.     // }}}
  350.     // {{{ getOverviewFmt()
  351.  
  352.     /**
  353.      * Returns a list of avaible headers which are send from NNTP-server to the client for every news message
  354.      *
  355.      * @return mixed (array) header names on success or (object) pear_error on failure
  356.      * @access public
  357.      * @see Net_NNTP_Client::getOverview()
  358.      */
  359.     function getOverviewFormat()
  360.     {
  361.         return $this->cmdListOverviewFmt();
  362.     }
  363.  
  364.     // }}}
  365.     // {{{ getReferencesOverview()
  366.  
  367.     /**
  368.      * Fetch a list of each message's reference header.
  369.      *
  370.      * @param integer $first first article to fetch
  371.      * @param integer $last  last article to fetch
  372.      *
  373.      * @return mixed (array) nested array of references on success or (object) pear_error on failure
  374.      * @access public
  375.      * @see Net_NNTP_Client::getOverview()
  376.      */
  377.     function getReferencesOverview($first$last)
  378.     {
  379.         $overview $this->cmdXROver($first.'-'.$last);
  380.         if (PEAR::isError($overview)) {
  381.             return $overview;
  382.         }
  383.     
  384.         return $overview;
  385.     }
  386.  
  387.     // }}}
  388.     // {{{ post()
  389.  
  390.     /**
  391.      * Post an article to a number of newsgroups.
  392.      *
  393.      * (Among the aditional headers you might think of adding could be:
  394.      * "NNTP-Posting-Host: <ip-of-author>", which should contain the IP-address
  395.      * of the author of the post, so the message can be traced back to him.
  396.      * Or "Organization: <org>" which contain the name of the organization
  397.      * the post originates from)
  398.      *
  399.      * @param string $newsgroups The newsgroup to post to.
  400.      * @param string $subject The subject of the post.
  401.      * @param string $body The body of the post itself.
  402.      * @param string $from Name + email-adress of sender.
  403.      * @param optional string $aditional Aditional headers to send.
  404.      *
  405.      * @return mixed (string) server response on success or (object) pear_error on failure
  406.      * @access public
  407.      */
  408.     function post($newsgroups$subject$body$from$aditional '')
  409.     {
  410.         return $this->cmdPost($newsgroups$subject$body$from$aditional);
  411.     }
  412.  
  413.     // }}}
  414.     // {{{ getArticle()
  415.  
  416.     /**
  417.      * Get an article
  418.      *
  419.      * The v0.2 version of the this function (which returned the article as a string) has been renamed to getArticleRaw().
  420.      *
  421.      * @param mixed $article Either the message-id or the message-number on the server of the article to fetch.
  422.      *
  423.      * @return mixed (object) message object on success or (object) pear_error on failure
  424.      * @access public
  425.      * @see Net_NNTP_Client::getArticleRaw()
  426.      * @see Net_NNTP_Client::getHeader()
  427.      * @see Net_NNTP_Client::getBody()
  428.      */
  429.     function getArticle($article)
  430.     {
  431.         $message $this->getArticleRaw($articlefalse);
  432.         if (PEAR::isError($message)) {
  433.             return $data;
  434.         }
  435.     
  436.         $M Net_NNTP_Message::create($message);
  437.     
  438.         return $M;
  439.     }
  440.  
  441.     // }}}
  442.     // {{{ getArticleRaw()
  443.  
  444.     /**
  445.      * Get a article (raw data)
  446.      *
  447.      * @param mixed $article Either the message-id or the message-number on the server of the article to fetch.
  448.      * @param optional bool  $implode When true the result array is imploded to a string, defaults to false.
  449.      *
  450.      * @return mixed (array/string) The article on success or (object) pear_error on failure
  451.      * @access public
  452.      * @see Net_NNTP_Client::getArticle()
  453.      * @see Net_NNTP_Client::getHeaderRaw()
  454.      * @see Net_NNTP_Client::getBodyRaw()
  455.      */
  456.     function getArticleRaw($article$implode = false)
  457.     {
  458.         $data $this->cmdArticle($article);
  459.         if (PEAR::isError($data)) {
  460.             return $data;
  461.         }
  462.  
  463.         if ($implode == true{
  464.             $data implode("\r\n"$data);
  465.         }
  466.  
  467.         return $data;
  468.     }
  469.  
  470.     // }}}
  471.     // {{{ getHeader()
  472.  
  473.     /**
  474.      * Get the header of an article
  475.      *
  476.      * @param mixed $article Either the (string) message-id or the (int) message-number on the server of the article to fetch.
  477.      *
  478.      * @return mixed (object) header object on success or (object) pear_error on failure
  479.      * @access public
  480.      * @see Net_NNTP_Client::getHeaderRaw()
  481.      * @see Net_NNTP_Client::getArticle()
  482.      * @see Net_NNTP_Client::getBody()
  483.      */
  484.     function getHeader($article)
  485.     {
  486.         $header $this->getHeaderRaw($articlefalse);
  487.         if (PEAR::isError($header)) {
  488.             return $header;
  489.         }
  490.  
  491.         $H Net_NNTP_Header::create($header);
  492.  
  493.         return $H;
  494.     }
  495.  
  496.     // }}}
  497.     // {{{ getHeaderRaw()
  498.  
  499.     /**
  500.      * Get the header of an article (raw data)
  501.      *
  502.      * @param mixed $article Either the (string) message-id or the (int) message-number on the server of the article to fetch.
  503.      * @param optional bool $implode When true the result array is imploded to a string, defaults to false.
  504.      *
  505.      * @return mixed (array/string) header fields on success or (object) pear_error on failure
  506.      * @access public
  507.      * @see Net_NNTP_Client::getHeader()
  508.      * @see Net_NNTP_Client::getArticleRaw()
  509.      * @see Net_NNTP_Client::getBodyRaw()
  510.      */
  511.     function getHeaderRaw($article$implode = false)
  512.     {
  513.         $data $this->cmdHead($article);
  514.         if (PEAR::isError($data)) {
  515.             return $data;
  516.         }
  517.  
  518.         if ($implode == true{
  519.             $data implode("\r\n"$data);
  520.         }
  521.  
  522.         return $data;
  523.     }
  524.  
  525.     // }}}
  526.     // {{{ getBody()
  527.  
  528.     // Not written yet...
  529.  
  530.     // }}}
  531.     // {{{ getBodyRaw()
  532.  
  533.     /**
  534.      * Get the body of an article (raw data)
  535.      *
  536.      * @param mixed $article Either the message-id or the message-number on the server of the article to fetch.
  537.      * @param optional bool $implode When true the result array is imploded to a string, defaults to false.
  538.      *
  539.      * @return mixed (array/string) body on success or (object) pear_error on failure
  540.      * @access public
  541.      * @see Net_NNTP_Client::getBody()
  542.      * @see Net_NNTP_Client::getHeaderRaw()
  543.      * @see Net_NNTP_Client::getArticleRaw()
  544.      */
  545.     function getBodyRaw($article$implode = false)
  546.     {
  547.         $data $this->cmdBody($article);
  548.         if (PEAR::isError($data)) {
  549.             return $data;
  550.         }
  551.     
  552.         if ($implode == true{
  553.             $data implode("\r\n"$data);
  554.         }
  555.     
  556.         return $data;
  557.     }
  558.  
  559.     // }}}
  560.     // {{{ getGroupArticles()
  561.  
  562.     /**
  563.      * Experimental
  564.      *
  565.      * @access public
  566.      * @since 0.3
  567.      */
  568.     function getGroupArticles($newsgroup)
  569.     {
  570.         return $this->cmdListgroup($newsgroup);
  571.     }
  572.  
  573.     // }}}
  574.     // {{{ getNewGroups()
  575.  
  576.     /**
  577.      * Experimental
  578.      *
  579.      * @access public
  580.      * @since 0.3
  581.      */
  582.     function getNewGroups($time)
  583.     {
  584.         switch (gettype($time)) {
  585.             case 'integer':
  586.                 break;
  587.             case 'string':
  588.                 $time = (int) strtotime($time);
  589.                 break;
  590.             default:
  591.                 return PEAR::throwError('');
  592.         }
  593.  
  594.         return $this->cmdNewgroups($time);
  595.     }
  596.  
  597.     // }}}
  598.     // {{{ getNewNews()
  599.  
  600.     /**
  601.      * Experimental
  602.      *
  603.      * @access public
  604.      * @since 0.3
  605.      */
  606.     function getNewNews($time$newsgroups '*')
  607.     {
  608.         switch (gettype($time)) {
  609.             case 'integer':
  610.                 break;
  611.             case 'string':
  612.                 $time = (int) strtotime($time);
  613.                 break;
  614.             default:
  615.                 return PEAR::throwError('UPS...');
  616.         }
  617.  
  618.         return $this->cmdNewnews($time$newsgroups);
  619.     }
  620.  
  621.     // }}}
  622.     // {{{ getDate()
  623.  
  624.     /**
  625.      * Get the NNTP-server's internal date
  626.      *
  627.      * Get the date from the newsserver format of returned date:
  628.      *
  629.      * @param optional int $format
  630.      *   - 0: $date - timestamp
  631.      *   - 1: $date['y'] - year
  632.      *        $date['m'] - month
  633.      *        $date['d'] - day
  634.      *
  635.      * @return mixed (mixed) date on success or (object) pear_error on failure
  636.      * @access public
  637.      * @since 0.3
  638.      */
  639.     function getDate($format = 1)
  640.     {
  641.         $date $this->cmdDate();
  642.         if (PEAR::isError($date)) {
  643.             return $date;
  644.         }
  645.  
  646.         switch ($format{
  647.             case 1:
  648.                 return array('y' => substr($date04)'m' => substr($date42)'d' => substr($date62));
  649.                 break;
  650.  
  651.             case 0:
  652.             default:
  653.                 return $date;
  654.                 break;
  655.         }
  656.     }
  657.  
  658.     // }}}
  659.     // {{{ count()
  660.  
  661.     /**
  662.      * Number of articles in currently selected group
  663.      *
  664.      * @return integer number of article in group
  665.      * @access public
  666.      * @since 0.3
  667.      * @see Net_NNTP_Client::group()
  668.      * @see Net_NNTP_Client::first()
  669.      * @see Net_NNTP_Client::last()
  670.      * @see Net_NNTP_Client::selectGroup()
  671.      */
  672.     function count()
  673.     {
  674.         return $this->_currentGroup['count'];
  675.     }
  676.  
  677.     // }}}
  678.     // {{{ last()
  679.  
  680.     /**
  681.      * Maximum article number in currently selected group
  682.      *
  683.      * @return integer number of last article
  684.      * @access public
  685.      * @since 0.3
  686.      * @see Net_NNTP_Client::first()
  687.      * @see Net_NNTP_Client::group()
  688.      * @see Net_NNTP_Client::count()
  689.      * @see Net_NNTP_Client::selectGroup()
  690.      */
  691.     function last()
  692.     {
  693.         return $this->_currentGroup['last'];
  694.     }
  695.  
  696.     // }}}
  697.     // {{{ first()
  698.  
  699.     /**
  700.      * Minimum article number in currently selected group
  701.      *
  702.      * @return integer number of first article
  703.      * @access public
  704.      * @since 0.3
  705.      * @see Net_NNTP_Client::last()
  706.      * @see Net_NNTP_Client::group()
  707.      * @see Net_NNTP_Client::count()
  708.      * @see Net_NNTP_Client::selectGroup()
  709.      */
  710.     function first()
  711.     {
  712.         return $this->_currentGroup['first'];
  713.     }
  714.  
  715.     // }}}
  716.     // {{{ group()
  717.  
  718.     /**
  719.      * Currently selected group
  720.      *
  721.      * @return string group name
  722.      * @access public
  723.      * @since 0.3
  724.      * @see Net_NNTP_Client::first()
  725.      * @see Net_NNTP_Client::last()
  726.      * @see Net_NNTP_Client::count()
  727.      * @see Net_NNTP_Client::selectGroup()
  728.      */
  729.     function group()
  730.     {
  731.         return $this->_currentGroup['group'];
  732.     }
  733.  
  734.     // }}}
  735.     // {{{ command()
  736.  
  737.     /**
  738.      * Issue a command to the NNTP server
  739.      *
  740.      * @param string $cmd The command to launch, ie: "ARTICLE 1004853"
  741.      *
  742.      * @return mixed (int) response code on success or (object) pear_error on failure
  743.      * @access public
  744.      */
  745.     function command($cmd)
  746.     {
  747.         return $this->_sendCommand($cmd);
  748.     }
  749.  
  750.     // }}}
  751.  
  752. }
  753.  
  754. // }}}
  755.  
  756. ?>

Documentation generated on Mon, 11 Mar 2019 13:55:00 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.