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.10 2004/09/06 17:45:27 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.10 2004/09/06 17:45:27 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.      * @deprecated use connect() and authenticate() instead
  154.      * @see Net_NNTP_Client::connect()
  155.      * @see Net_NNTP_Client::authenticate()
  156.      * @see Net_NNTP_Client::quit()
  157.      */
  158.     function connectAuthenticated($user = null,
  159.                                   $pass = null,
  160.                                   $host = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_HOST,
  161.                                   $port = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_PORT,
  162.                                   $authmode = NET_NNTP_CLIENT_AUTH_ORIGINAL)
  163.     {
  164.     $R $this->connect($host$port);
  165.     if (PEAR::isError($R)) {
  166.         return $R;
  167.     }
  168.  
  169.     // Authenticate if username is given
  170.     if ($user != null{
  171.             $R $this->authenticate($user$pass$authmode);
  172.             if (PEAR::isError($R)) {
  173.                 return $R;
  174.             }
  175.     }
  176.  
  177.         return true;
  178.     }
  179.  
  180.     // }}}
  181.     // {{{ quit()
  182.  
  183.     /**
  184.      * Close connection to the newsserver
  185.      *
  186.      * @access public
  187.      * @see Net_NNTP_Client::connect()
  188.      */
  189.     function quit()
  190.     {
  191.         return $this->cmdQuit();
  192.     }
  193.  
  194.     // }}}
  195.     // {{{ authenticate()
  196.  
  197.     /**
  198.      * Authenticate
  199.      * 
  200.      * Auth process (not yet standarized but used any way)
  201.      * http://www.mibsoftware.com/userkt/nntpext/index.html
  202.      *
  203.      * @param string $user The username
  204.      * @param optional string $pass The password
  205.      * @param optional string $mode The authentication mode (original, simple, generic).
  206.      *
  207.      * @return mixed (bool) true on success or (object) pear_error on failure
  208.      * @access public
  209.      * @see Net_NNTP_Client::connect()
  210.      * @see Net_NNTP_Client::connectAuthenticated()
  211.      */
  212.     function authenticate($user$pass$mode = NET_NNTP_CLIENT_AUTH_ORIGINAL)
  213.     {
  214.         // Username is a must...
  215.         if ($user == null{
  216.             return PEAR::throwError('No username supplied'null);
  217.         }
  218.  
  219.         // Use selected authentication method
  220.         switch ($mode{
  221.             case NET_NNTP_CLIENT_AUTH_ORIGINAL:
  222.                 return $this->cmdAuthinfo($user$pass);
  223.                 break;
  224.             case NET_NNTP_CLIENT_AUTH_SIMPLE:
  225.                 return $this->cmdAuthinfoSimple($user$pass);
  226.                 break;
  227.             case NET_NNTP_CLIENT_AUTH_GENERIC:
  228.                 return $this->cmdAuthinfoGeneric($user$pass);
  229.                 break;
  230.             default:
  231.                 return PEAR::throwError("The auth mode: '$mode' is unknown"null);
  232.         }
  233.     }
  234.  
  235.     // }}}
  236.     // {{{ isConnected()
  237.  
  238.     /**
  239.      * Test whether a connection is currently open.
  240.      *
  241.      * @return bool true or false
  242.      * @access public
  243.      * @see Net_NNTP_Client::connect()
  244.      * @see Net_NNTP_Client::quit()
  245.      */
  246.     function isConnected()
  247.     {
  248.         return parent::isConnected();
  249.     }
  250.  
  251.     // }}}
  252.     // {{{ selectGroup()
  253.  
  254.     /**
  255.      * Selects a newsgroup
  256.      *
  257.      * @param string $newsgroup Newsgroup name
  258.      *
  259.      * @return mixed (array) Info about the newsgroup on success or (object) pear_error on failure
  260.      * @access public
  261.      * @see Net_NNTP_Client::group()
  262.      * @see Net_NNTP_Client::first()
  263.      * @see Net_NNTP_Client::last()
  264.      * @see Net_NNTP_Client::count()
  265.      * @see Net_NNTP_Client::getGroups()
  266.      */
  267.     function selectGroup($newsgroup)
  268.     {
  269.         $response_arr $this->cmdGroup($newsgroup);
  270.         if (PEAR::isError($response_arr)) {
  271.             return $response_arr;
  272.         }
  273.  
  274.         // Store group info in the object
  275.         $this->_currentGroup $response_arr;
  276.  
  277.         return $response_arr;
  278.     }
  279.  
  280.     // }}}
  281.     // {{{ getGroups()
  282.  
  283.     /**
  284.      * Fetches a list of all avaible newsgroups
  285.      *
  286.      * @return mixed (array) nested array with informations about existing newsgroups on success or (object) pear_error on failure
  287.      * @access public
  288.      * @see Net_NNTP_Client::selectGroup()
  289.      * @see Net_NNTP_Client::getDescriptions()
  290.      */
  291.     function getGroups()
  292.     {
  293.         // Get groups
  294.         $groups $this->cmdList();
  295.         if (PEAR::isError($groups)) {
  296.             return $groups;
  297.         }
  298.  
  299.         return $groups;
  300.     }
  301.  
  302.     // }}}
  303.     // {{{ getDescriptions()
  304.  
  305.     /**
  306.      * Fetches a list of all avaible newsgroup descriptions.
  307.      *
  308.      * @return mixed (array) nested array with description of existing newsgroups on success or (object) pear_error on failure
  309.      * @access public
  310.      * @see Net_NNTP_Client::getGroups()
  311.      */
  312.     function getDescriptions()
  313.     {
  314.         // Get group descriptions
  315.         $descriptions $this->cmdListNewsgroups();
  316.         if (PEAR::isError($descriptions)) {
  317.             return $descriptions;
  318.         }
  319.     
  320.         return $descriptions;
  321.     }
  322.  
  323.     // }}}
  324.     // {{{ getOverview()
  325.  
  326.     /**
  327.      * Fetch message header fields from message number $first to $last
  328.      *
  329.      * The format of the returned array is:
  330.      * $messages[message_id][header_name]
  331.      *
  332.      * @param integer $first first article to fetch
  333.      * @param integer $last  last article to fetch
  334.      *
  335.      * @return mixed (array) nested array of message and their headers on success or (object) pear_error on failure
  336.      * @access public
  337.      * @see Net_NNTP_Client::getOverviewFormat()
  338.      * @see Net_NNTP_Client::getReferencesOverview()
  339.      */
  340.     function getOverview($first$last)
  341.     {
  342.         $overview $this->cmdXOver($first.'-'.$last);
  343.         if (PEAR::isError($overview)) {
  344.             return $overview;
  345.         }
  346.     
  347.         return $overview;
  348.     }
  349.  
  350.     // }}}
  351.     // {{{ getOverviewFmt()
  352.  
  353.     /**
  354.      * Returns a list of avaible headers which are send from NNTP-server to the client for every news message
  355.      *
  356.      * @return mixed (array) header names on success or (object) pear_error on failure
  357.      * @access public
  358.      * @see Net_NNTP_Client::getOverview()
  359.      */
  360.     function getOverviewFormat()
  361.     {
  362.         return $this->cmdListOverviewFmt();
  363.     }
  364.  
  365.     // }}}
  366.     // {{{ getReferencesOverview()
  367.  
  368.     /**
  369.      * Fetch a list of each message's reference header.
  370.      *
  371.      * @param integer $first first article to fetch
  372.      * @param integer $last  last article to fetch
  373.      *
  374.      * @return mixed (array) nested array of references on success or (object) pear_error on failure
  375.      * @access public
  376.      * @see Net_NNTP_Client::getOverview()
  377.      */
  378.     function getReferencesOverview($first$last)
  379.     {
  380.         $overview $this->cmdXROver($first.'-'.$last);
  381.         if (PEAR::isError($overview)) {
  382.             return $overview;
  383.         }
  384.     
  385.         return $overview;
  386.     }
  387.  
  388.     // }}}
  389.     // {{{ post()
  390.  
  391.     /**
  392.      * Post an article to a number of newsgroups.
  393.      *
  394.      * (Among the aditional headers you might think of adding could be:
  395.      * "NNTP-Posting-Host: <ip-of-author>", which should contain the IP-address
  396.      * of the author of the post, so the message can be traced back to him.
  397.      * Or "Organization: <org>" which contain the name of the organization
  398.      * the post originates from)
  399.      *
  400.      * @param string $newsgroups The newsgroup to post to.
  401.      * @param string $subject The subject of the post.
  402.      * @param string $body The body of the post itself.
  403.      * @param string $from Name + email-adress of sender.
  404.      * @param optional string $aditional Aditional headers to send.
  405.      *
  406.      * @return mixed (string) server response on success or (object) pear_error on failure
  407.      * @access public
  408.      */
  409.     function post($newsgroups$subject$body$from$aditional '')
  410.     {
  411.         return $this->cmdPost($newsgroups$subject$body$from$aditional);
  412.     }
  413.  
  414.     // }}}
  415.     // {{{ getArticle()
  416.  
  417.     /**
  418.      * Get an article
  419.      *
  420.      * Experimental
  421.      *
  422.      * The v0.2 version of the this function (which returned the article as a string) has been renamed to getArticleRaw().
  423.      *
  424.      * @param mixed $article Either the message-id or the message-number on the server of the article to fetch.
  425.      *
  426.      * @return mixed (object) message object on success or (object) pear_error on failure
  427.      * @access public
  428.      * @see Net_NNTP_Client::getArticleRaw()
  429.      * @see Net_NNTP_Client::getHeader()
  430.      * @see Net_NNTP_Client::getBody()
  431.      */
  432.     function getArticle($article)
  433.     {
  434.         $message $this->getArticleRaw($articlefalse);
  435.         if (PEAR::isError($message)) {
  436.             return $data;
  437.         }
  438.     
  439.         $M Net_NNTP_Message::create($message);
  440.     
  441.         return $M;
  442.     }
  443.  
  444.     // }}}
  445.     // {{{ getArticleRaw()
  446.  
  447.     /**
  448.      * Get a article (raw data)
  449.      *
  450.      * @param mixed $article Either the message-id or the message-number on the server of the article to fetch.
  451.      * @param optional bool  $implode When true the result array is imploded to a string, defaults to false.
  452.      *
  453.      * @return mixed (array/string) The article on success or (object) pear_error on failure
  454.      * @access public
  455.      * @see Net_NNTP_Client::getArticle()
  456.      * @see Net_NNTP_Client::getHeaderRaw()
  457.      * @see Net_NNTP_Client::getBodyRaw()
  458.      */
  459.     function getArticleRaw($article$implode = false)
  460.     {
  461.         $data $this->cmdArticle($article);
  462.         if (PEAR::isError($data)) {
  463.             return $data;
  464.         }
  465.  
  466.         if ($implode == true{
  467.             $data implode("\r\n"$data);
  468.         }
  469.  
  470.         return $data;
  471.     }
  472.  
  473.     // }}}
  474.     // {{{ getHeader()
  475.  
  476.     /**
  477.      * Get the header of an article
  478.      *
  479.      * Experimental
  480.      *
  481.      * @param mixed $article Either the (string) message-id or the (int) message-number on the server of the article to fetch.
  482.      *
  483.      * @return mixed (object) header object on success or (object) pear_error on failure
  484.      * @access public
  485.      * @see Net_NNTP_Client::getHeaderRaw()
  486.      * @see Net_NNTP_Client::getArticle()
  487.      * @see Net_NNTP_Client::getBody()
  488.      */
  489.     function getHeader($article)
  490.     {
  491.         $header $this->getHeaderRaw($articlefalse);
  492.         if (PEAR::isError($header)) {
  493.             return $header;
  494.         }
  495.  
  496.         $H Net_NNTP_Header::create($header);
  497.  
  498.         return $H;
  499.     }
  500.  
  501.     // }}}
  502.     // {{{ getHeaderRaw()
  503.  
  504.     /**
  505.      * Get the header of an article (raw data)
  506.      *
  507.      * @param mixed $article Either the (string) message-id or the (int) message-number on the server of the article to fetch.
  508.      * @param optional bool $implode When true the result array is imploded to a string, defaults to false.
  509.      *
  510.      * @return mixed (array/string) header fields on success or (object) pear_error on failure
  511.      * @access public
  512.      * @see Net_NNTP_Client::getHeader()
  513.      * @see Net_NNTP_Client::getArticleRaw()
  514.      * @see Net_NNTP_Client::getBodyRaw()
  515.      */
  516.     function getHeaderRaw($article$implode = false)
  517.     {
  518.         $data $this->cmdHead($article);
  519.         if (PEAR::isError($data)) {
  520.             return $data;
  521.         }
  522.  
  523.         if ($implode == true{
  524.             $data implode("\r\n"$data);
  525.         }
  526.  
  527.         return $data;
  528.     }
  529.  
  530.     // }}}
  531.     // {{{ getBody()
  532.  
  533.     // Not written yet...
  534.  
  535.     // }}}
  536.     // {{{ getBodyRaw()
  537.  
  538.     /**
  539.      * Get the body of an article (raw data)
  540.      *
  541.      * @param mixed $article Either the message-id or the message-number on the server of the article to fetch.
  542.      * @param optional bool $implode When true the result array is imploded to a string, defaults to false.
  543.      *
  544.      * @return mixed (array/string) body on success or (object) pear_error on failure
  545.      * @access public
  546.      * @see Net_NNTP_Client::getBody()
  547.      * @see Net_NNTP_Client::getHeaderRaw()
  548.      * @see Net_NNTP_Client::getArticleRaw()
  549.      */
  550.     function getBodyRaw($article$implode = false)
  551.     {
  552.         $data $this->cmdBody($article);
  553.         if (PEAR::isError($data)) {
  554.             return $data;
  555.         }
  556.     
  557.         if ($implode == true{
  558.             $data implode("\r\n"$data);
  559.         }
  560.     
  561.         return $data;
  562.     }
  563.  
  564.     // }}}
  565.     // {{{ getGroupArticles()
  566.  
  567.     /**
  568.      * Experimental
  569.      *
  570.      * @access public
  571.      * @since 0.3
  572.      */
  573.     function getGroupArticles($newsgroup)
  574.     {
  575.         return $this->cmdListgroup($newsgroup);
  576.     }
  577.  
  578.     // }}}
  579.     // {{{ getNewGroups()
  580.  
  581.     /**
  582.      * Experimental
  583.      *
  584.      * @access public
  585.      * @since 0.3
  586.      */
  587.     function getNewGroups($time$distributions = null)
  588.     {
  589.         switch (gettype($time)) {
  590.             case 'integer':
  591.                 break;
  592.             case 'string':
  593.                 $time = (int) strtotime($time);
  594.                 break;
  595.             default:
  596.                 return PEAR::throwError('UPS...');
  597.         }
  598.  
  599.         return $this->cmdNewgroups($time$distributions);
  600.     }
  601.  
  602.     // }}}
  603.     // {{{ getNewNews()
  604.  
  605.     /**
  606.      * Experimental
  607.      *
  608.      * @access public
  609.      * @since 0.3
  610.      */
  611.     function getNewNews($time$newsgroups '*')
  612.     {
  613.         switch (gettype($time)) {
  614.             case 'integer':
  615.                 break;
  616.             case 'string':
  617.                 $time = (int) strtotime($time);
  618.                 break;
  619.             default:
  620.                 return PEAR::throwError('UPS...');
  621.         }
  622.  
  623.         return $this->cmdNewnews($time$newsgroups);
  624.     }
  625.  
  626.     // }}}
  627.     // {{{ getDate()
  628.  
  629.     /**
  630.      * Get the NNTP-server's internal date
  631.      *
  632.      * Get the date from the newsserver format of returned date:
  633.      *
  634.      * @param optional int $format
  635.      *   - 0: $date - timestamp
  636.      *   - 1: $date['y'] - year
  637.      *        $date['m'] - month
  638.      *        $date['d'] - day
  639.      *
  640.      * @return mixed (mixed) date on success or (object) pear_error on failure
  641.      * @access public
  642.      * @since 0.3
  643.      */
  644.     function getDate($format = 1)
  645.     {
  646.         $date $this->cmdDate();
  647.         if (PEAR::isError($date)) {
  648.             return $date;
  649.         }
  650.  
  651.         switch ($format{
  652.             case 1:
  653.                 return array('y' => substr($date04)'m' => substr($date42)'d' => substr($date62));
  654.                 break;
  655.  
  656.             case 0:
  657.             default:
  658.                 return $date;
  659.                 break;
  660.         }
  661.     }
  662.  
  663.     // }}}
  664.     // {{{ count()
  665.  
  666.     /**
  667.      * Number of articles in currently selected group
  668.      *
  669.      * @return integer number of article in group
  670.      * @access public
  671.      * @since 0.3
  672.      * @see Net_NNTP_Client::group()
  673.      * @see Net_NNTP_Client::first()
  674.      * @see Net_NNTP_Client::last()
  675.      * @see Net_NNTP_Client::selectGroup()
  676.      */
  677.     function count()
  678.     {
  679.         return $this->_currentGroup['count'];
  680.     }
  681.  
  682.     // }}}
  683.     // {{{ last()
  684.  
  685.     /**
  686.      * Maximum article number in currently selected group
  687.      *
  688.      * @return integer number of last article
  689.      * @access public
  690.      * @since 0.3
  691.      * @see Net_NNTP_Client::first()
  692.      * @see Net_NNTP_Client::group()
  693.      * @see Net_NNTP_Client::count()
  694.      * @see Net_NNTP_Client::selectGroup()
  695.      */
  696.     function last()
  697.     {
  698.         return $this->_currentGroup['last'];
  699.     }
  700.  
  701.     // }}}
  702.     // {{{ first()
  703.  
  704.     /**
  705.      * Minimum article number in currently selected group
  706.      *
  707.      * @return integer number of first article
  708.      * @access public
  709.      * @since 0.3
  710.      * @see Net_NNTP_Client::last()
  711.      * @see Net_NNTP_Client::group()
  712.      * @see Net_NNTP_Client::count()
  713.      * @see Net_NNTP_Client::selectGroup()
  714.      */
  715.     function first()
  716.     {
  717.         return $this->_currentGroup['first'];
  718.     }
  719.  
  720.     // }}}
  721.     // {{{ group()
  722.  
  723.     /**
  724.      * Currently selected group
  725.      *
  726.      * @return string group name
  727.      * @access public
  728.      * @since 0.3
  729.      * @see Net_NNTP_Client::first()
  730.      * @see Net_NNTP_Client::last()
  731.      * @see Net_NNTP_Client::count()
  732.      * @see Net_NNTP_Client::selectGroup()
  733.      */
  734.     function group()
  735.     {
  736.         return $this->_currentGroup['group'];
  737.     }
  738.  
  739.     // }}}
  740.     // {{{ command()
  741.  
  742.     /**
  743.      * Issue a command to the NNTP server
  744.      *
  745.      * @param string $cmd The command to launch, ie: "ARTICLE 1004853"
  746.      *
  747.      * @return mixed (int) response code on success or (object) pear_error on failure
  748.      * @access public
  749.      */
  750.     function command($cmd)
  751.     {
  752.         return $this->_sendCommand($cmd);
  753.     }
  754.  
  755.     // }}}
  756.  
  757. }
  758.  
  759. // }}}
  760.  
  761. ?>

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