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.  * 
  6.  * 
  7.  * PHP versions 4 and 5
  8.  *
  9.  * <pre>
  10.  * +-----------------------------------------------------------------------+
  11.  * |                                                                       |
  12.  * | http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231   |
  13.  * |                                                                       |
  14.  * | This work (and included software, documentation such as READMEs,      |
  15.  * | or other related items) is being provided by the copyright holders    |
  16.  * | under the following license. By obtaining, using and/or copying       |
  17.  * | this work, you (the licensee) agree that you have read, understood,   |
  18.  * | and will comply with the following terms and conditions.              |
  19.  * |                                                                       |
  20.  * | Permission to copy, modify, and distribute this software and its      |
  21.  * | documentation, with or without modification, for any purpose and      |
  22.  * | without fee or royalty is hereby granted, provided that you include   |
  23.  * | the following on ALL copies of the software and documentation or      |
  24.  * | portions thereof, including modifications:                            |
  25.  * |                                                                       |
  26.  * | 1. The full text of this NOTICE in a location viewable to users       |
  27.  * |    of the redistributed or derivative work.                           |
  28.  * |                                                                       |
  29.  * | 2. Any pre-existing intellectual property disclaimers, notices,       |
  30.  * |    or terms and conditions. If none exist, the W3C Software Short     |
  31.  * |    Notice should be included (hypertext is preferred, text is         |
  32.  * |    permitted) within the body of any redistributed or derivative      |
  33.  * |    code.                                                              |
  34.  * |                                                                       |
  35.  * | 3. Notice of any changes or modifications to the files, including     |
  36.  * |    the date changes were made. (We recommend you provide URIs to      |
  37.  * |    the location from which the code is derived.)                      |
  38.  * |                                                                       |
  39.  * | THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT    |
  40.  * | HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,    |
  41.  * | INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR        |
  42.  * | FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE    |
  43.  * | OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,           |
  44.  * | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.                               |
  45.  * |                                                                       |
  46.  * | COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,        |
  47.  * | SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE        |
  48.  * | SOFTWARE OR DOCUMENTATION.                                            |
  49.  * |                                                                       |
  50.  * | The name and trademarks of copyright holders may NOT be used in       |
  51.  * | advertising or publicity pertaining to the software without           |
  52.  * | specific, written prior permission. Title to copyright in this        |
  53.  * | software and any associated documentation will at all times           |
  54.  * | remain with copyright holders.                                        |
  55.  * |                                                                       |
  56.  * +-----------------------------------------------------------------------+
  57.  * </pre>
  58.  *
  59.  * @category   Net
  60.  * @package    Net_NNTP
  61.  * @author     Heino H. Gehlsen <heino@gehlsen.dk>
  62.  * @copyright  2002-2011 Heino H. Gehlsen <heino@gehlsen.dk>. All Rights Reserved.
  63.  * @license
  64.  * @version    SVN: $Id: Client.php 317347 2011-09-26 20:26:12Z janpascal $
  65.  * @link       http://pear.php.net/package/Net_NNTP
  66.  * @see
  67.  *
  68.  * @filesource
  69.  */
  70.  
  71. /**
  72.  *
  73.  */
  74. require_once 'Net/NNTP/Protocol/Client.php';
  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.  * @version    package: 1.5.0 (stable)
  87.  * @version    api: 0.9.0 (alpha)
  88.  * @access     public
  89.  * @see        Net_NNTP_Protocol_Client
  90.  */
  91. class Net_NNTP_Client extends Net_NNTP_Protocol_Client
  92. {
  93.     // {{{ properties
  94.  
  95.     /**
  96.      * Information summary about the currently selected group.
  97.      *
  98.      * @var array 
  99.      * @access private
  100.      */
  101.     var $_selectedGroupSummary = null;
  102.  
  103.     /**
  104.      * 
  105.      *
  106.      * @var array 
  107.      * @access private
  108.      * @since 1.3.0
  109.      */
  110.     var $_overviewFormatCache = null;
  111.  
  112.     // }}}
  113.     // {{{ constructor
  114.  
  115.     /**
  116.      * Constructor
  117.      *
  118.      * <b>Usage example:</b>
  119.      * {@example docs/examples/phpdoc/constructor.php}
  120.      *
  121.      * @access public
  122.      */
  123.     function Net_NNTP_Client()
  124.     {
  125.         parent::Net_NNTP_Protocol_Client();
  126.     }
  127.  
  128.     // }}}
  129.     // {{{ connect()
  130.  
  131.     /**
  132.      * Connect to a server.
  133.      *
  134.      * xxx
  135.      * 
  136.      * <b>Usage example:</b>
  137.      * {@example docs/examples/phpdoc/connect.php}
  138.      *
  139.      * @param string    $host    (optional) The hostname og IP-address of the NNTP-server to connect to, defaults to localhost.
  140.      * @param mixed    $encryption    (optional) false|'tls'|'ssl', defaults to false.
  141.      * @param int    $port    (optional) The port number to connect to, defaults to 119 or 563 dependng on $encryption.
  142.      * @param int    $timeout    (optional)
  143.      *
  144.      * @return mixed <br>
  145.      *   - (bool)    True when posting allowed, otherwise false
  146.      *   - (object)    Pear_Error on failure
  147.      * @access public
  148.      * @see Net_NNTP_Client::disconnect()
  149.      * @see Net_NNTP_Client::authenticate()
  150.      */
  151.     function connect($host = null$encryption = null$port = null$timeout = null)
  152.     {
  153.         // v1.0.x API
  154.         if (is_int($encryption)) {
  155.         trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: connect() !'E_USER_NOTICE);
  156.             $port $encryption;
  157.         $encryption = null;
  158.         }
  159.  
  160.         return parent::connect($host$encryption$port$timeout);
  161.     }
  162.  
  163.     // }}}
  164.     // {{{ disconnect()
  165.  
  166.     /**
  167.      * Disconnect from server.
  168.      *
  169.      * @return mixed <br>
  170.      *   - (bool)
  171.      *   - (object)    Pear_Error on failure
  172.      * @access public
  173.      * @see Net_NNTP_Client::connect()
  174.      */
  175.     function disconnect()
  176.     {
  177.         return parent::disconnect();
  178.     }
  179.  
  180.     // }}}
  181.     // {{{ quit()
  182.  
  183.     /**
  184.      * Deprecated alias for disconnect().
  185.      *
  186.      * @access public
  187.      * @deprecated
  188.      * @ignore
  189.      */
  190.     function quit()
  191.     {
  192.         return $this->disconnect();
  193.     }
  194.  
  195.     // }}}
  196.     // {{{ authenticate()
  197.  
  198.     /**
  199.      * Authenticate.
  200.      *
  201.      * xxx
  202.      *
  203.      * <b>Non-standard!</b><br>
  204.      * This method uses non-standard commands, which is not part
  205.      * of the original RFC977, but has been formalized in RFC2890.
  206.      *
  207.      * <b>Usage example:</b>
  208.      * {@example docs/examples/phpdoc/authenticate.php}
  209.      *
  210.      * @param string    $user    The username
  211.      * @param string    $pass    The password
  212.      *
  213.      * @return mixed <br>
  214.      *   - (bool)    True on successful authentification, otherwise false
  215.      *   - (object)    Pear_Error on failure
  216.      * @access public
  217.      * @see Net_NNTP_Client::connect()
  218.      */
  219.     function authenticate($user$pass)
  220.     {
  221.         // Username is a must...
  222.         if ($user == null{
  223.             return $this->throwError('No username supplied'null);
  224.         }
  225.  
  226.         return $this->cmdAuthinfo($user$pass);
  227.     }
  228.  
  229.     // }}}
  230.     // {{{ selectGroup()
  231.  
  232.     /**
  233.      * Selects a group.
  234.      * 
  235.      * Moves the servers 'currently selected group' pointer to the group
  236.      * a new group, and returns summary information about it.
  237.      *
  238.      * <b>Non-standard!</b><br>
  239.      * When using the second parameter,
  240.      * This method uses non-standard commands, which is not part
  241.      * of the original RFC977, but has been formalized in RFC2890.
  242.      *
  243.      * <b>Usage example:</b>
  244.      * {@example docs/examples/phpdoc/selectGroup.php}
  245.      *
  246.      * @param string    $group    Name of the group to select
  247.      * @param mixed    $articles    (optional) experimental! When true the article numbers is returned in 'articles'
  248.      *
  249.      * @return mixed <br>
  250.      *   - (array)    Summary about the selected group
  251.      *   - (object)    Pear_Error on failure
  252.      * @access public
  253.      * @see Net_NNTP_Client::getGroups()
  254.      * @see Net_NNTP_Client::group()
  255.      * @see Net_NNTP_Client::first()
  256.      * @see Net_NNTP_Client::last()
  257.      * @see Net_NNTP_Client::count()
  258.      */
  259.     function selectGroup($group$articles = false)
  260.     {
  261.     // Select group (even if $articles is set, since many servers does not select groups when the listgroup command is run)
  262.         $summary $this->cmdGroup($group);
  263.         if (PEAR::isError($summary)) {
  264.             return $summary;
  265.         }
  266.  
  267.         // Store group info in the object
  268.         $this->_selectedGroupSummary $summary;
  269.  
  270.     // 
  271.         if ($articles !== false{
  272.             $summary2 $this->cmdListgroup($group($articles === true ? null : $articles));
  273.             if (PEAR::isError($summary2)) {
  274.                 return $summary2;
  275.             }
  276.  
  277.         // Make sure the summary array is correct...
  278.             if ($summary2['group'== $group{
  279.                 $summary $summary2;
  280.  
  281.         // ... even if server does not include summary in status reponce.
  282.             else {
  283.                 $summary['articles'$summary2['articles'];
  284.             }
  285.         }
  286.     
  287.         return $summary;
  288.     }
  289.  
  290.     // }}}
  291.     // {{{ selectPreviousArticle()
  292.  
  293.     /**
  294.      * Select the previous article.
  295.      *
  296.      * Select the previous article in current group.
  297.      *
  298.      * <b>Usage example:</b>
  299.      * {@example docs/examples/phpdoc/selectPreviousArticle.php}
  300.      *
  301.      * @param int    $_ret    (optional) Experimental
  302.      *
  303.      * @return mixed <br>
  304.      *   - (integer)    Article number, if $ret=0 (default)
  305.      *   - (string)    Message-id, if $ret=1
  306.      *   - (array)    Both article number and message-id, if $ret=-1
  307.      *   - (bool)    False if no prevoius article exists
  308.      *   - (object)    Pear_Error on failure
  309.      * @access public
  310.      * @see Net_NNTP_Client::selectArticle()
  311.      * @see Net_NNTP_Client::selectNextArticle()
  312.      */
  313.     function selectPreviousArticle($_ret = 0)
  314.     {
  315.         $response $this->cmdLast();
  316.  
  317.         if (PEAR::isError($response)) {
  318.             return false;
  319.         }
  320.  
  321.         switch ($_ret{
  322.             case -1:
  323.                 return array('Number' => (int) $response[0]'Message-ID' =>  (string) $response[1]);
  324.                 break;
  325.             case 0:
  326.                 return (int) $response[0];
  327.                 break;
  328.             case 1:
  329.                 return (string) $response[1];
  330.                 break;
  331.             default:
  332.         error()// ...
  333.     }
  334.     }
  335.  
  336.     // }}}
  337.     // {{{ selectNextArticle()
  338.  
  339.     /**
  340.      * Select the next article.
  341.      *
  342.      * Select the next article in current group.
  343.      *
  344.      * <b>Usage example:</b>
  345.      * {@example docs/examples/phpdoc/selectNextArticle.php}
  346.      *
  347.      * @param int    $_ret    (optional) Experimental
  348.      *
  349.      * @return mixed <br>
  350.      *   - (integer)    Article number, if $ret=0 (default)
  351.      *   - (string)    Message-id, if $ret=1
  352.      *   - (array)    Both article number and message-id, if $ret=-1
  353.      *   - (bool)    False if no further articles exist
  354.      *   - (object)    Pear_Error on unexpected failure
  355.      * @access public
  356.      * @see Net_NNTP_Client::selectArticle()
  357.      * @see Net_NNTP_Client::selectPreviousArticle()
  358.      */
  359.     function selectNextArticle($_ret = 0)
  360.     {
  361.         $response $this->cmdNext();
  362.  
  363.         if (PEAR::isError($response)) {
  364.             return $response;
  365.     }
  366.  
  367.         switch ($_ret{
  368.             case -1:
  369.                 return array('Number' => (int) $response[0]'Message-ID' =>  (string) $response[1]);
  370.                 break;
  371.             case 0:
  372.                 return (int) $response[0];
  373.                 break;
  374.             case 1:
  375.                 return (string) $response[1];
  376.                 break;
  377.             default:
  378.         error()// ...
  379.     }
  380.     }
  381.  
  382.     // }}}
  383.     // {{{ selectArticle()
  384.  
  385.     /**
  386.      * Selects an article by article message-number.
  387.      *
  388.      * xxx
  389.      *
  390.      * <b>Usage example:</b>
  391.      * {@example docs/examples/phpdoc/selectArticle.php}
  392.      *
  393.      * @param mixed    $article    The message-number (on the server) of
  394.      *                                   the article to select as current article.
  395.      * @param int    $_ret    (optional) Experimental
  396.      *
  397.      * @return mixed <br>
  398.      *   - (integer)    Article number
  399.      *   - (bool)    False if article doesn't exists
  400.      *   - (object)    Pear_Error on failure
  401.      * @access public
  402.      * @see Net_NNTP_Client::selectNextArticle()
  403.      * @see Net_NNTP_Client::selectPreviousArticle()
  404.      */
  405.     function selectArticle($article = null$_ret = 0)
  406.     {
  407.         $response $this->cmdStat($article);
  408.  
  409.         if (PEAR::isError($response)) {
  410.             return $response;
  411.     }
  412.  
  413.         switch ($_ret{
  414.             case -1:
  415.                 return array('Number' => (int) $response[0]'Message-ID' =>  (string) $response[1]);
  416.                 break;
  417.             case 0:
  418.                 return (int) $response[0];
  419.                 break;
  420.             case 1:
  421.                 return (string) $response[1];
  422.                 break;
  423.             default:
  424.         error()// ...
  425.     }
  426.     }
  427.  
  428.     // }}}
  429.     // {{{ getArticle()
  430.  
  431.     /**
  432.      * Fetch article into transfer object.
  433.      *
  434.      * Select an article based on the arguments, and return the entire
  435.      * article (raw data).
  436.      *
  437.      * <b>Usage example:</b>
  438.      * {@example docs/examples/phpdoc/getArticle.php}
  439.      *
  440.      * @param mixed    $article    (optional) Either the message-id or the
  441.      *                                   message-number on the server of the
  442.      *                                   article to fetch.
  443.      * @param bool    $implode    (optional) When true the result array
  444.      *                                   is imploded to a string, defaults to
  445.      *                                   false.
  446.      *
  447.      * @return mixed <br>
  448.      *   - (array)    Complete article (when $implode is false)
  449.      *   - (string)    Complete article (when $implode is true)
  450.      *   - (object)    Pear_Error on failure
  451.      * @access public
  452.      * @see Net_NNTP_Client::getHeader()
  453.      * @see Net_NNTP_Client::getBody()
  454.      */
  455.     function getArticle($article = null$implode = false)
  456.     {
  457.         // v1.1.x API
  458.         if (is_string($implode)) {
  459.             trigger_error('You are using deprecated API v1.1 in Net_NNTP_Client: getHeader() !'E_USER_NOTICE);
  460.              
  461.             $class $implode;
  462.             $implode = false;
  463.  
  464.             if (!class_exists($class)) {
  465.                 return $this->throwError("Class '$class' does not exist!");
  466.         }
  467.         }
  468.  
  469.         $data $this->cmdArticle($article);
  470.         if (PEAR::isError($data)) {
  471.             return $data;
  472.         }
  473.  
  474.         if ($implode == true{
  475.             $data implode("\r\n"$data);
  476.         }
  477.  
  478.         // v1.1.x API
  479.         if (isset($class)) {
  480.             return $obj = new $class($data);
  481.         }
  482.  
  483.         //
  484.         return $data;
  485.     }
  486.  
  487.     // }}}
  488.     // {{{ getHeader()
  489.  
  490.     /**
  491.      * Fetch article header.
  492.      *
  493.      * Select an article based on the arguments, and return the article
  494.      * header (raw data).
  495.      *
  496.      * <b>Usage example:</b>
  497.      * {@example docs/examples/phpdoc/getHeader.php}
  498.      *
  499.      * @param mixed    $article    (optional) Either message-id or message
  500.      *                                   number of the article to fetch.
  501.      * @param bool    $implode    (optional) When true the result array
  502.      *                                   is imploded to a string, defaults to
  503.      *                                   false.
  504.      *
  505.      * @return mixed <br>
  506.      *   - (bool)    False if article does not exist
  507.      *   - (array)    Header fields (when $implode is false)
  508.      *   - (string)    Header fields (when $implode is true)
  509.      *   - (object)    Pear_Error on failure
  510.      * @access public
  511.      * @see Net_NNTP_Client::getArticle()
  512.      * @see Net_NNTP_Client::getBody()
  513.      */
  514.     function getHeader($article = null$implode = false)
  515.     {
  516.         // v1.1.x API
  517.         if (is_string($implode)) {
  518.             trigger_error('You are using deprecated API v1.1 in Net_NNTP_Client: getHeader() !'E_USER_NOTICE);
  519.              
  520.             $class $implode;
  521.             $implode = false;
  522.  
  523.             if (!class_exists($class)) {
  524.                 return $this->throwError("Class '$class' does not exist!");
  525.         }
  526.         }
  527.  
  528.         $data $this->cmdHead($article);
  529.         if (PEAR::isError($data)) {
  530.             return $data;
  531.         }
  532.  
  533.         if ($implode == true{
  534.             $data implode("\r\n"$data);
  535.         }
  536.  
  537.         // v1.1.x API
  538.         if (isset($class)) {
  539.             return $obj = new $class($data);
  540.         }
  541.  
  542.         //
  543.         return $data;
  544.     }
  545.  
  546.     // }}}
  547.     // {{{ getBody()
  548.  
  549.     /**
  550.      * Fetch article body.
  551.      *
  552.      * Select an article based on the arguments, and return the article
  553.      * body (raw data).
  554.      *
  555.      * <b>Usage example:</b>
  556.      * {@example docs/examples/phpdoc/getBody.php}
  557.      *
  558.      * @param mixed    $article    (optional) Either the message-id or the
  559.      *                                   message-number on the server of the
  560.      *                                   article to fetch.
  561.      * @param bool    $implode    (optional) When true the result array
  562.      *                                   is imploded to a string, defaults to
  563.      *                                   false.
  564.      *
  565.      * @return mixed <br>
  566.      *   - (array)    Message body (when $implode is false)
  567.      *   - (string)    Message body (when $implode is true)
  568.      *   - (object)    Pear_Error on failure
  569.      * @access public
  570.      * @see Net_NNTP_Client::getHeader()
  571.      * @see Net_NNTP_Client::getArticle()
  572.      */
  573.     function getBody($article = null$implode = false)
  574.     {
  575.         // v1.1.x API
  576.         if (is_string($implode)) {
  577.             trigger_error('You are using deprecated API v1.1 in Net_NNTP_Client: getHeader() !'E_USER_NOTICE);
  578.              
  579.             $class $implode;
  580.             $implode = false;
  581.  
  582.             if (!class_exists($class)) {
  583.                 return $this->throwError("Class '$class' does not exist!");
  584.         }
  585.         }
  586.  
  587.         $data $this->cmdBody($article);
  588.         if (PEAR::isError($data)) {
  589.             return $data;
  590.         }
  591.  
  592.         if ($implode == true{
  593.             $data implode("\r\n"$data);
  594.         }
  595.  
  596.         // v1.1.x API
  597.         if (isset($class)) {
  598.             return $obj = new $class($data);
  599.         }
  600.  
  601.         //
  602.         return $data;
  603.     }
  604.  
  605.     // }}}
  606.     // {{{ post()
  607.  
  608.     /**
  609.      * Post a raw article to a number of groups.
  610.      *
  611.      * <b>Usage example:</b>
  612.      * {@example docs/examples/phpdoc/post.php}
  613.      *
  614.      * @param mixed    $article    <br>
  615.      *   - (string) Complete article in a ready to send format (lines terminated by LFCR etc.)
  616.      *   - (array) First key is the article header, second key is article body - any further keys are ignored !!!
  617.      *   - (mixed) Something 'callable' (which must return otherwise acceptable data as replacement)
  618.      *
  619.      * @return mixed <br>
  620.      *   - (string)    Server response
  621.      *   - (object)    Pear_Error on failure
  622.      * @access public
  623.      * @ignore
  624.      */
  625.     function post($article)
  626.     {
  627.         // API v1.0
  628.         if (func_num_args(>= 4{
  629.  
  630.             // 
  631.             trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: post() !'E_USER_NOTICE);
  632.  
  633.             //
  634.             $groups func_get_arg(0);
  635.             $subject func_get_arg(1);
  636.             $body func_get_arg(2);
  637.             $from func_get_arg(3);
  638.             $additional func_get_arg(4);
  639.  
  640.             return $this->mail($groups$subject$body"From: $from\r\n" . $additional);
  641.         }
  642.  
  643.         // Only accept $article if array or string
  644.         if (!is_array($article&& !is_string($article)) {
  645.             return $this->throwError('Ups'null0);
  646.         }
  647.  
  648.         // Check if server will receive an article
  649.         $post $this->cmdPost();
  650.         if (PEAR::isError($post)) {
  651.             return $post;
  652.         }
  653.  
  654.         // Get article data from callback function
  655.         if (is_callable($article)) {
  656.             $article call_user_func($article);
  657.         }
  658.  
  659.         // Actually send the article
  660.         return $this->cmdPost2($article);
  661.     }
  662.  
  663.     // }}}
  664.     // {{{ mail()
  665.  
  666.     /**
  667.      * Post an article to a number of groups - using same parameters as PHP's mail() function.
  668.      *
  669.      * Among the aditional headers you might think of adding could be:
  670.      * "From: <author-email-address>", which should contain the e-mail address
  671.      * of the author of the article.
  672.      * Or "Organization: <org>" which contain the name of the organization
  673.      * the post originates from.
  674.      * Or "NNTP-Posting-Host: <ip-of-author>", which should contain the IP-address
  675.      * of the author of the post, so the message can be traced back to him.
  676.      *
  677.      * <b>Usage example:</b>
  678.      * {@example docs/examples/phpdoc/mail.php}
  679.      *
  680.      * @param string    $groups    The groups to post to.
  681.      * @param string    $subject    The subject of the article.
  682.      * @param string    $body    The body of the article.
  683.      * @param string    $additional    (optional) Additional header fields to send.
  684.      *
  685.      * @return mixed <br>
  686.      *   - (string)    Server response
  687.      *   - (object)    Pear_Error on failure
  688.      * @access public
  689.      */
  690.     function mail($groups$subject$body$additional = null)
  691.     {
  692.         // Check if server will receive an article
  693.         $post $this->cmdPost();
  694.         if (PEAR::isError($post)) {
  695.             return $post;
  696.         }
  697.  
  698.         // Construct header
  699.         $header  = "Newsgroups: $groups\r\n";
  700.         $header .= "Subject: $subject\r\n";
  701.         $header .= "X-poster: PEAR::Net_NNTP v1.5.0 (stable)\r\n";
  702.         if ($additional !== null{
  703.             $header .= $additional;
  704.         }
  705.         $header .= "\r\n";
  706.  
  707.         // Actually send the article
  708.         return $this->cmdPost2(array($header$body));
  709.     }
  710.  
  711.     // }}}
  712.     // {{{ getDate()
  713.  
  714.     /**
  715.      * Get the server's internal date
  716.      *
  717.      * <b>Non-standard!</b><br>
  718.      * This method uses non-standard commands, which is not part
  719.      * of the original RFC977, but has been formalized in RFC2890.
  720.      *
  721.      * <b>Usage example:</b>
  722.      * {@example docs/examples/phpdoc/getDate.php}
  723.      *
  724.      * @param int    $format    (optional) Determines the format of returned date:
  725.      *                            - 0: return string
  726.      *                            - 1: return integer/timestamp
  727.      *                            - 2: return an array('y'=>year, 'm'=>month,'d'=>day)
  728.      *
  729.      * @return mixed <br>
  730.      *   - (mixed)
  731.      *   - (object)    Pear_Error on failure
  732.      * @access public
  733.      */
  734.     function getDate($format = 1)
  735.     {
  736.         $date $this->cmdDate();
  737.         if (PEAR::isError($date)) {
  738.             return $date;
  739.         }
  740.  
  741.         switch ($format{
  742.             case 0:
  743.                 return $date;
  744.                 break;
  745.             case 1:
  746.             return strtotime(substr($date08).' '.substr($date82).':'.substr($date102).':'.substr($date122));
  747.                 break;
  748.             case 2:
  749.                 return array('y' => substr($date04),
  750.                              'm' => substr($date42),
  751.                              'd' => substr($date62));
  752.                 break;
  753.             default:
  754.         error();
  755.         }
  756.     }
  757.  
  758.     // }}}
  759.     // {{{ getNewGroups()
  760.  
  761.     /**
  762.      * Get new groups since a date.
  763.      *
  764.      * Returns a list of groups created on the server since the specified date
  765.      * and time.
  766.      *
  767.      * <b>Usage example:</b>
  768.      * {@example docs/examples/phpdoc/getNewGroups.php}
  769.      *
  770.      * @param mixed    $time    <br>
  771.      *   - (integer)    A timestamp
  772.      *   - (string)    Somthing parseable by strtotime() like '-1 week'
  773.      * @param string    $distributions    (optional)
  774.      *
  775.      * @return mixed <br>
  776.      *   - (array)
  777.      *   - (object)    Pear_Error on failure
  778.      * @access public
  779.      */
  780.     function getNewGroups($time$distributions = null)
  781.     {
  782.         switch (true{
  783.             case is_integer($time):
  784.                 break;
  785.             case is_string($time):
  786.                 $time strtotime($time);
  787.                 if ($time === false || ($time === -1 && version_compare(phpversion()'5.1.0''<'))) {
  788.                     return $this->throwError('$time could not be converted into a timestamp!'null0);
  789.                 }
  790.                 break;
  791.             default:
  792.                 trigger_error('$time must be either a string or an integer/timestamp!'E_USER_ERROR);
  793.         }
  794.  
  795.         return $this->cmdNewgroups($time$distributions);
  796.     }
  797.  
  798.     // }}}
  799.     // {{{ getNewArticles()
  800.  
  801.     /**
  802.      * Get new articles since a date.
  803.      *
  804.      * Returns a list of message-ids of new articles (since the specified date
  805.      * and time) in the groups whose names match the wildmat
  806.      *
  807.      * <b>Usage example:</b>
  808.      * {@example docs/examples/phpdoc/getNewArticles.php}
  809.      *
  810.      * @param mixed    $time    <br>
  811.      *   - (integer)    A timestamp
  812.      *   - (string)    Somthing parseable by strtotime() like '-1 week'
  813.      * @param string    $groups    (optional)
  814.      * @param string    $distributions    (optional)
  815.      *
  816.      * @return mixed <br>
  817.      *   - (array)
  818.      *   - (object)    Pear_Error on failure
  819.      * @access public
  820.      * @since 1.3.0
  821.      */
  822.     function getNewArticles($time$groups '*'$distribution = null)
  823.     {
  824.         switch (true{
  825.             case is_integer($time):
  826.                 break;
  827.             case is_string($time):
  828.                 $time strtotime($time);
  829.                 if ($time === false || ($time === -1 && version_compare(php_version()'5.1.0''<'))) {
  830.                     return $this->throwError('$time could not be converted into a timestamp!'null0);
  831.         }
  832.                 break;
  833.             default:
  834.                 trigger_error('$time must be either a string or an integer/timestamp!'E_USER_ERROR);
  835.         }
  836.  
  837.         return $this->cmdNewnews($time$groups$distribution);
  838.     }
  839.  
  840.     // }}}
  841.     // {{{ getGroups()
  842.  
  843.     /**
  844.      * Fetch valid groups.
  845.      *
  846.      * Returns a list of valid groups (that the client is permitted to select)
  847.      * and associated information.
  848.      *
  849.      * <b>Usage example:</b>
  850.      * {@example docs/examples/phpdoc/getGroups.php}
  851.      *
  852.      * @return mixed <br>
  853.      *   - (array)    Nested array with information about every valid group
  854.      *   - (object)    Pear_Error on failure
  855.      * @access public
  856.      * @see Net_NNTP_Client::getDescriptions()
  857.      * @see Net_NNTP_Client::selectGroup()
  858.      */
  859.     function getGroups($wildmat = null)
  860.     {
  861.         $backup = false;
  862.  
  863.         // Get groups
  864.         $groups $this->cmdListActive($wildmat);
  865.         if (PEAR::isError($groups)) {
  866.             switch ($groups->getCode()) {
  867.                 case 500:
  868.                 case 501:
  869.                     $backup = true;
  870.             break;
  871.             default:
  872.                     return $groups;
  873.             }
  874.         }
  875.  
  876.         // 
  877.         if ($backup == true{
  878.  
  879.             // 
  880.             if (!is_null($wildmat)) {
  881.                 return $this->throwError("The server does not support the 'LIST ACTIVE' command, and the 'LIST' command does not support the wildmat parameter!"nullnull);
  882.             }
  883.         
  884.             // 
  885.             $groups2 $this->cmdList();
  886.             if (PEAR::isError($groups2)) {
  887.             // Ignore...
  888.             else {
  889.                 $groups $groups2;
  890.             }
  891.     }
  892.  
  893.         if (PEAR::isError($groups)) {
  894.             return $groups;
  895.         }
  896.  
  897.         return $groups;
  898.     }
  899.  
  900.     // }}}
  901.     // {{{ getDescriptions()
  902.  
  903.     /**
  904.      * Fetch all known group descriptions.
  905.      *
  906.      * Fetches a list of known group descriptions - including groups which
  907.      * the client is not permitted to select.
  908.      *
  909.      * <b>Non-standard!</b><br>
  910.      * This method uses non-standard commands, which is not part
  911.      * of the original RFC977, but has been formalized in RFC2890.
  912.      *
  913.      * <b>Usage example:</b>
  914.      * {@example docs/examples/phpdoc/getDescriptions.php}
  915.      *
  916.      * @param mixed    $wildmat    (optional)
  917.      *
  918.      * @return mixed <br>
  919.      *   - (array)    Associated array with descriptions of known groups
  920.      *   - (object)    Pear_Error on failure
  921.      * @access public
  922.      * @see Net_NNTP_Client::getGroups()
  923.      */
  924.     function getDescriptions($wildmat = null)
  925.     {
  926.         if (is_array($wildmat)) {
  927.         $wildmat implode(','$wildmat);
  928.         }
  929.  
  930.         // Get group descriptions
  931.         $descriptions $this->cmdListNewsgroups($wildmat);
  932.         if (PEAR::isError($descriptions)) {
  933.             return $descriptions;
  934.         }
  935.  
  936.         // TODO: add xgtitle as backup
  937.     
  938.         return $descriptions;
  939.     }
  940.  
  941.     // }}}
  942.     // {{{ getOverview()
  943.  
  944.     /**
  945.      * Fetch an overview of article(s) in the currently selected group.
  946.      *
  947.      * Returns the contents of all the fields in the database for a number
  948.      * of articles specified by either article-numnber range, a message-id,
  949.      * or nothing (indicating currently selected article).
  950.      *
  951.      * The first 8 fields per article is always as follows:
  952.      *   - 'Number' - '0' or the article number of the currently selected group.
  953.      *   - 'Subject' - header content.
  954.      *   - 'From' - header content.
  955.      *   - 'Date' - header content.
  956.      *   - 'Message-ID' - header content.
  957.      *   - 'References' - header content.
  958.      *   - ':bytes' - metadata item.
  959.      *   - ':lines' - metadata item.
  960.      *
  961.      * The server may send more fields form it's database...
  962.      *
  963.      * <b>Non-standard!</b><br>
  964.      * This method uses non-standard commands, which is not part
  965.      * of the original RFC977, but has been formalized in RFC2890.
  966.      *
  967.      * <b>Usage example:</b>
  968.      * {@example docs/examples/phpdoc/getOverview.php}
  969.      *
  970.      * @param mixed    $range    (optional)
  971.      *                           - '<message number>'
  972.      *                           - '<message number>-<message number>'
  973.      *                           - '<message number>-'
  974.      *                           - '<message-id>'
  975.      * @param boolean    $_names    (optional) experimental parameter! Use field names as array kays
  976.      * @param boolean    $_forceNames    (optional) experimental parameter!
  977.      *
  978.      * @return mixed <br>
  979.      *   - (array)    Nested array of article overview data
  980.      *   - (object)    Pear_Error on failure
  981.      * @access public
  982.      * @see Net_NNTP_Client::getHeaderField()
  983.      * @see Net_NNTP_Client::getOverviewFormat()
  984.      */
  985.     function getOverview($range = null$_names = true$_forceNames = true)
  986.     {
  987.         // API v1.0
  988.         switch (true{
  989.         // API v1.3
  990.         case func_num_args(!= 2:
  991.         case is_bool(func_get_arg(1)):
  992.         case !is_int(func_get_arg(1)) || (is_string(func_get_arg(1)) && ctype_digit(func_get_arg(1))):
  993.         case !is_int(func_get_arg(0)) || (is_string(func_get_arg(0)) && ctype_digit(func_get_arg(0))):
  994.         break;
  995.  
  996.         default:
  997.                 // 
  998.                 trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: getOverview() !'E_USER_NOTICE);
  999.  
  1000.                 // Fetch overview via API v1.3
  1001.                 $overview $this->getOverview(func_get_arg(0'-' func_get_arg(1)truefalse);
  1002.                 if (PEAR::isError($overview)) {
  1003.                     return $overview;
  1004.                 }
  1005.  
  1006.                 // Create and return API v1.0 compliant array
  1007.                 $articles = array();
  1008.                 foreach ($overview as $article{
  1009.  
  1010.                     // Rename 'Number' field into 'number'
  1011.                     $article array_merge(array('number' => array_shift($article))$article);
  1012.         
  1013.                     // Use 'Message-ID' field as key
  1014.                     $articles[$article['Message-ID']] $article;
  1015.                 }
  1016.                 return $articles;
  1017.         }
  1018.  
  1019.         // Fetch overview from server
  1020.         $overview $this->cmdXOver($range);
  1021.         if (PEAR::isError($overview)) {
  1022.             return $overview;
  1023.         }
  1024.  
  1025.         // Use field names from overview format as keys?
  1026.         if ($_names{
  1027.  
  1028.             // Already cached?
  1029.             if (is_null($this->_overviewFormatCache)) {
  1030.                 // Fetch overview format
  1031.                 $format $this->getOverviewFormat($_forceNamestrue);
  1032.                 if (PEAR::isError($format)){
  1033.                     return $format;
  1034.                 }
  1035.  
  1036.                 // Prepend 'Number' field
  1037.                 $format array_merge(array('Number' => false)$format);
  1038.  
  1039.                 // Cache format
  1040.                 $this->_overviewFormatCache $format;
  1041.  
  1042.             // 
  1043.             else {
  1044.                 $format $this->_overviewFormatCache;
  1045.             }
  1046.  
  1047.             // Loop through all articles
  1048.             foreach ($overview as $key => $article{
  1049.  
  1050.                 // Copy $format
  1051.                 $f $format;
  1052.  
  1053.                 // Field counter
  1054.                 $i = 0;
  1055.         
  1056.         // Loop through forld names in format
  1057.                 foreach ($f as $tag => $full{
  1058.  
  1059.                     //
  1060.                     $f[$tag$article[$i++];
  1061.  
  1062.                     // If prefixed by field name, remove it
  1063.                     if ($full === true{
  1064.                     $f[$tagltrimsubstr($f[$tag]strpos($f[$tag]':'+ 1)" \t");
  1065.                     }
  1066.                 }
  1067.  
  1068.                 // Replace article 
  1069.             $overview[$key$f;
  1070.             }
  1071.         }
  1072.  
  1073.         //
  1074.         switch (true{
  1075.  
  1076.             // Expect one article
  1077.             case is_null($range);
  1078.             case is_int($range);
  1079.             case is_string($range&& ctype_digit($range):
  1080.             case is_string($range&& substr($range01== '<' && substr($range-11== '>':
  1081.                 if (count($overview== 0{
  1082.                     return false;
  1083.                 else {
  1084.                     return reset($overview);
  1085.                 }
  1086.                 break;
  1087.  
  1088.             // Expect multiple articles
  1089.             default:
  1090.                 return $overview;
  1091.         }
  1092.     }
  1093.  
  1094.     // }}}
  1095.     // {{{ getOverviewFormat()
  1096.  
  1097.     /**
  1098.      * Fetch names of fields in overview database
  1099.      *
  1100.      * Returns a description of the fields in the database for which it is consistent.
  1101.      *
  1102.      * <b>Non-standard!</b><br>
  1103.      * This method uses non-standard commands, which is not part
  1104.      * of the original RFC977, but has been formalized in RFC2890.
  1105.      *
  1106.      * <b>Usage example:</b>
  1107.      * {@example docs/examples/phpdoc/getOveriewFormat.php}
  1108.      *
  1109.      * @return mixed <br>
  1110.      *   - (array)    Overview field names
  1111.      *   - (object)    Pear_Error on failure
  1112.      * @access public
  1113.      * @see Net_NNTP_Client::getOverview()
  1114.      */
  1115.     function getOverviewFormat($_forceNames = true$_full = false)
  1116.     {
  1117.         $format $this->cmdListOverviewFmt();
  1118.         if (PEAR::isError($format)) {
  1119.             return $format;
  1120.         }
  1121.  
  1122.         // Force name of first seven fields
  1123.         if ($_forceNames{
  1124.             array_splice($format07);
  1125.             $format array_merge(array('Subject'    => false,
  1126.                                         'From'       => false,
  1127.                                         'Date'       => false,
  1128.                                         'Message-ID' => false,
  1129.                                         'References' => false,
  1130.                                         ':bytes'     => false,
  1131.                                         ':lines'     => false)$format);
  1132.         }
  1133.  
  1134.         if ($_full{
  1135.             return $format;
  1136.         else {
  1137.             return array_keys($format);
  1138.         }
  1139.     }
  1140.  
  1141.     // }}}
  1142.     // {{{ getHeaderField()
  1143.  
  1144.     /**
  1145.      * Fetch content of a header field from message(s).
  1146.      *
  1147.      * Retreives the content of specific header field from a number of messages.
  1148.      *
  1149.      * <b>Non-standard!</b><br>
  1150.      * This method uses non-standard commands, which is not part
  1151.      * of the original RFC977, but has been formalized in RFC2890.
  1152.      *
  1153.      * <b>Usage example:</b>
  1154.      * {@example docs/examples/phpdoc/getHeaderField.php}
  1155.      *
  1156.      * @param string    $field    The name of the header field to retreive
  1157.      * @param mixed    $range    (optional)
  1158.      *                             '<message number>'
  1159.      *                             '<message number>-<message number>'
  1160.      *                             '<message number>-'
  1161.      *                             '<message-id>'
  1162.      *
  1163.      * @return mixed <br>
  1164.      *   - (array)    Nested array of
  1165.      *   - (object)    Pear_Error on failure
  1166.      * @access public
  1167.      * @see Net_NNTP_Client::getOverview()
  1168.      * @see Net_NNTP_Client::getReferences()
  1169.      */
  1170.     function getHeaderField($field$range = null)
  1171.     {
  1172.         $fields $this->cmdXHdr($field$range);
  1173.         if (PEAR::isError($fields)) {
  1174.             return $fields;
  1175.         }
  1176.  
  1177.         //
  1178.         switch (true{
  1179.  
  1180.             // Expect one article
  1181.             case is_null($range);
  1182.             case is_int($range);
  1183.             case is_string($range&& ctype_digit($range):
  1184.             case is_string($range&& substr($range01== '<' && substr($range-11== '>':
  1185.  
  1186.                 if (count($fields== 0{
  1187.                     return false;
  1188.                 else {
  1189.                     return reset($fields);
  1190.                 }
  1191.                 break;
  1192.  
  1193.             // Expect multiple articles
  1194.             default:
  1195.                 return $fields;
  1196.         }
  1197.     }
  1198.  
  1199.     // }}}
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.     // {{{ getGroupArticles()
  1208.  
  1209.     /**
  1210.      *
  1211.      *
  1212.      * <b>Non-standard!</b><br>
  1213.      * This method uses non-standard commands, which is not part
  1214.      * of the original RFC977, but has been formalized in RFC2890.
  1215.      *
  1216.      * <b>Usage example:</b>
  1217.      * {@example docs/examples/phpdoc/getGroupArticles.php}
  1218.      *
  1219.      * @param mixed    $range    (optional) Experimental!
  1220.      *
  1221.      * @return mixed <br>
  1222.      *   - (array)
  1223.      *   - (object)    Pear_Error on failure
  1224.      * @access public
  1225.      * @since 1.3.0
  1226.      */
  1227.     function getGroupArticles($range = null)
  1228.     {
  1229.         $summary $this->cmdListgroup();
  1230.         if (PEAR::isError($summary)) {
  1231.             return $summary;
  1232.         }
  1233.  
  1234.         // Update summary cache if group was also 'selected'
  1235.         if ($summary['group'!== null{
  1236.             $this->_selectedGroupSummary($summary);
  1237.         }
  1238.     
  1239.         //
  1240.         return $summary['articles'];
  1241.     }
  1242.  
  1243.     // }}}
  1244.     // {{{ getReferences()
  1245.  
  1246.     /**
  1247.      * Fetch reference header field of message(s).
  1248.      *
  1249.      * Retrieves the content of the references header field of messages via
  1250.      * either the XHDR ord the XROVER command.
  1251.      *
  1252.      * Identical to getHeaderField('References').
  1253.      *
  1254.      * <b>Non-standard!</b><br>
  1255.      * This method uses non-standard commands, which is not part
  1256.      * of the original RFC977, but has been formalized in RFC2890.
  1257.      *
  1258.      * <b>Usage example:</b>
  1259.      * {@example docs/examples/phpdoc/getReferences.php}
  1260.      *
  1261.      * @param mixed    $range    (optional)
  1262.      *                             '<message number>'
  1263.      *                             '<message number>-<message number>'
  1264.      *                             '<message number>-'
  1265.      *                             '<message-id>'
  1266.      *
  1267.      * @return mixed <br>
  1268.      *   - (array)    Nested array of references
  1269.      *   - (object)    Pear_Error on failure
  1270.      * @access public
  1271.      * @see Net_NNTP_Client::getHeaderField()
  1272.      */
  1273.     function getReferences($range = null)
  1274.     {
  1275.         $backup = false;
  1276.  
  1277.         $references $this->cmdXHdr('References'$range);
  1278.         if (PEAR::isError($references)) {
  1279.             switch ($references->getCode()) {
  1280.                 case 500:
  1281.                 case 501:
  1282.                     $backup = true;
  1283.             break;
  1284.             default:
  1285.                     return $references;
  1286.             }
  1287.         }
  1288.  
  1289.         if (true && (is_array($references&& count($references== 0)) {
  1290.             $backup = true;
  1291.         }
  1292.  
  1293.         if ($backup == true{
  1294.             $references2 $this->cmdXROver($range);
  1295.             if (PEAR::isError($references2)) {
  1296.             // Ignore...
  1297.             else {
  1298.                 $references $references2;
  1299.             }
  1300.     }
  1301.  
  1302.         if (PEAR::isError($references)) {
  1303.             return $references;
  1304.         }
  1305.  
  1306.         if (is_array($references)) {
  1307.             foreach ($references as $key => $val{
  1308.                 $references[$keypreg_split("/ +/"trim($val)-1PREG_SPLIT_NO_EMPTY);
  1309.             }
  1310.     }
  1311.  
  1312.         //
  1313.         switch (true{
  1314.  
  1315.             // Expect one article
  1316.             case is_null($range);
  1317.             case is_int($range);
  1318.             case is_string($range&& ctype_digit($range):
  1319.             case is_string($range&& substr($range01== '<' && substr($range-11== '>':
  1320.                 if (count($references== 0{
  1321.                     return false;
  1322.                 else {
  1323.                     return reset($references);
  1324.                 }
  1325.                 break;
  1326.  
  1327.             // Expect multiple articles
  1328.             default:
  1329.                 return $references;
  1330.         }
  1331.     }
  1332.  
  1333.     // }}}
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.     // {{{ count()
  1340.  
  1341.     /**
  1342.      * Number of articles in currently selected group
  1343.      *
  1344.      * <b>Usage example:</b>
  1345.      * {@example docs/examples/phpdoc/count.php}
  1346.      *
  1347.      * @return mixed <br>
  1348.      *   - (string)    the number of article in group
  1349.      *   - (object)    Pear_Error on failure
  1350.      * @access public
  1351.      * @see Net_NNTP_Client::group()
  1352.      * @see Net_NNTP_Client::first()
  1353.      * @see Net_NNTP_Client::last()
  1354.      * @see Net_NNTP_Client::selectGroup()
  1355.      * @ignore
  1356.      */
  1357.     function count()
  1358.     {
  1359.         return $this->_selectedGroupSummary['count'];
  1360.     }
  1361.  
  1362.     // }}}
  1363.     // {{{ last()
  1364.  
  1365.     /**
  1366.      * Maximum article number in currently selected group
  1367.      *
  1368.      * <b>Usage example:</b>
  1369.      * {@example docs/examples/phpdoc/last.php}
  1370.      *
  1371.      * @return mixed <br>
  1372.      *   - (string)    the last article's number
  1373.      *   - (object)    Pear_Error on failure
  1374.      * @access public
  1375.      * @see Net_NNTP_Client::first()
  1376.      * @see Net_NNTP_Client::group()
  1377.      * @see Net_NNTP_Client::count()
  1378.      * @see Net_NNTP_Client::selectGroup()
  1379.      * @ignore
  1380.      */
  1381.     function last()
  1382.     {
  1383.         return $this->_selectedGroupSummary['last'];
  1384.     }
  1385.  
  1386.     // }}}
  1387.     // {{{ first()
  1388.  
  1389.     /**
  1390.      * Minimum article number in currently selected group
  1391.      *
  1392.      * <b>Usage example:</b>
  1393.      * {@example docs/examples/phpdoc/first.php}
  1394.      *
  1395.      * @return mixed <br>
  1396.      *   - (string)    the first article's number
  1397.      *   - (object)    Pear_Error on failure
  1398.      * @access public
  1399.      * @see Net_NNTP_Client::last()
  1400.      * @see Net_NNTP_Client::group()
  1401.      * @see Net_NNTP_Client::count()
  1402.      * @see Net_NNTP_Client::selectGroup()
  1403.      * @ignore
  1404.      */
  1405.     function first()
  1406.     {
  1407.         return $this->_selectedGroupSummary['first'];
  1408.     }
  1409.  
  1410.     // }}}
  1411.     // {{{ group()
  1412.  
  1413.     /**
  1414.      * Currently selected group
  1415.      *
  1416.      * <b>Usage example:</b>
  1417.      * {@example docs/examples/phpdoc/group.php}
  1418.      *
  1419.      * @return mixed <br>
  1420.      *   - (string)    group name
  1421.      *   - (object)    Pear_Error on failure
  1422.      * @access public
  1423.      * @see Net_NNTP_Client::first()
  1424.      * @see Net_NNTP_Client::last()
  1425.      * @see Net_NNTP_Client::count()
  1426.      * @see Net_NNTP_Client::selectGroup()
  1427.      * @ignore
  1428.      */
  1429.     function group()
  1430.     {
  1431.         return $this->_selectedGroupSummary['group'];
  1432.     }
  1433.  
  1434.     // }}}
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.     // {{{ isConnected()
  1443.  
  1444.     /**
  1445.      * Test whether a connection is currently open or closed.
  1446.      *
  1447.      * @return bool    True if connected, otherwise false
  1448.      * @access public
  1449.      * @see Net_NNTP_Client::connect()
  1450.      * @see Net_NNTP_Client::quit()
  1451.      * @deprecated    since v1.3.0 due to use of protected method: Net_NNTP_Protocol_Client::isConnected()
  1452.      * @ignore
  1453.      */
  1454.     function isConnected()
  1455.     {
  1456.     trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: isConnected() !'E_USER_NOTICE);
  1457.         return parent::_isConnected();
  1458.     }
  1459.  
  1460.     // }}}
  1461.     // {{{ getArticleRaw()
  1462.  
  1463.     /**
  1464.      * Deprecated alias for getArticle()
  1465.      *
  1466.      * @deprecated
  1467.      * @ignore
  1468.      */
  1469.     function getArticleRaw($article$implode = false)
  1470.     {
  1471.         trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: getArticleRaw() !'E_USER_NOTICE);
  1472.         return $this->getArticle($article$implode);
  1473.     }
  1474.  
  1475.     // }}}
  1476.     // {{{ getHeaderRaw()
  1477.  
  1478.     /**
  1479.      * Deprecated alias for getHeader()
  1480.      *
  1481.      * @deprecated
  1482.      * @ignore
  1483.      */
  1484.     function getHeaderRaw($article = null$implode = false)
  1485.     {
  1486.         trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: getHeaderRaw() !'E_USER_NOTICE);
  1487.         return $this->getHeader($article$implode);
  1488.     }
  1489.  
  1490.     // }}}
  1491.     // {{{ getBodyRaw()
  1492.  
  1493.     /**
  1494.      * Deprecated alias for getBody()
  1495.      *
  1496.      * @deprecated
  1497.      * @ignore
  1498.      */
  1499.     function getBodyRaw($article = null$implode = false)
  1500.     {
  1501.         trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: getBodyRaw() !'E_USER_NOTICE);
  1502.         return $this->getBody($article$implode);
  1503.     }
  1504.  
  1505.     // }}}
  1506.     // {{{ getNewNews()
  1507.  
  1508.     /**
  1509.      * Deprecated alias for getNewArticles()
  1510.      *
  1511.      * @deprecated
  1512.      * @ignore
  1513.      */
  1514.     function getNewNews($time$groups '*'$distribution = null)
  1515.     {
  1516.         trigger_error('You are using deprecated API v1.1 in Net_NNTP_Client: getNewNews() !'E_USER_NOTICE);
  1517.         return $this->getNewArticles($time$groups$distribution);
  1518.     }
  1519.  
  1520.     // }}}
  1521.     // {{{ getReferencesOverview()
  1522.  
  1523.     /**
  1524.      * Deprecated alias for getReferences()
  1525.      *
  1526.      * @deprecated
  1527.      * @ignore
  1528.      */
  1529.     function getReferencesOverview($first$last)
  1530.     {
  1531.     trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: getReferencesOverview() !'E_USER_NOTICE);
  1532.         return $this->getReferences($first '-' $last);
  1533.     }
  1534.  
  1535.     // }}}
  1536.  
  1537. }
  1538.  
  1539. // }}}
  1540.  
  1541. /*
  1542.  * Local variables:
  1543.  * tab-width: 4
  1544.  * c-basic-offset: 4
  1545.  * c-hanging-comment-ender-p: nil
  1546.  * End:
  1547.  */
  1548.  
  1549. ?>

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