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

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