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

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