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-2005 Heino H. Gehlsen <heino@gehlsen.dk>. All Rights Reserved.
  63.  * @license
  64.  * @version    CVS: $Id: Client.php,v 1.13 2005/12/22 12:19:58 heino Exp $
  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.3.1 (alpha)
  87.  * @version    api: 0.8.1 (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.         // 
  649.         $post $this->cmdPost();
  650.         if (PEAR::isError($post)) {
  651.             return $post;
  652.         }
  653.  
  654.         // 
  655.         if (is_callable($article)) {
  656.             $article call_user_func($article);
  657.         }
  658.  
  659.         // 
  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.         //
  693.         $header  = "Newsgroups: $groups\r\n";
  694.         $header .= "Subject: $subject\r\n";
  695.         $header .= "X-poster: PEAR::Net_NNTP v1.3.1 (alpha)\r\n";
  696.         if ($additional !== null{
  697.             $header .= $additional;
  698.         }
  699.  
  700.         return $this->cmdPost(array($header$body));
  701.     }
  702.  
  703.     // }}}
  704.     // {{{ getDate()
  705.  
  706.     /**
  707.      * Get the server's internal date
  708.      *
  709.      * <b>Non-standard!</b><br>
  710.      * This method uses non-standard commands, which is not part
  711.      * of the original RFC977, but has been formalized in RFC2890.
  712.      *
  713.      * <b>Usage example:</b>
  714.      * {@example docs/examples/phpdoc/getDate.php}
  715.      *
  716.      * @param int    $format    (optional) Determines the format of returned date:
  717.      *                            - 0: return string
  718.      *                            - 1: return integer/timestamp
  719.      *                            - 2: return an array('y'=>year, 'm'=>month,'d'=>day)
  720.      *
  721.      * @return mixed <br>
  722.      *   - (mixed)
  723.      *   - (object)    Pear_Error on failure
  724.      * @access public
  725.      */
  726.     function getDate($format = 1)
  727.     {
  728.         $date $this->cmdDate();
  729.         if (PEAR::isError($date)) {
  730.             return $date;
  731.         }
  732.  
  733.         switch ($format{
  734.             case 0:
  735.                 return $date;
  736.                 break;
  737.             case 1:
  738.             return strtotime(substr($date08).' '.substr($date82).':'.substr($date102).':'.substr($date122));
  739.                 break;
  740.             case 2:
  741.                 return array('y' => substr($date04),
  742.                              'm' => substr($date42),
  743.                              'd' => substr($date62));
  744.                 break;
  745.             default:
  746.         error();
  747.         }
  748.     }
  749.  
  750.     // }}}
  751.     // {{{ getNewGroups()
  752.  
  753.     /**
  754.      * Get new groups since a date.
  755.      *
  756.      * Returns a list of groups created on the server since the specified date
  757.      * and time.
  758.      *
  759.      * <b>Usage example:</b>
  760.      * {@example docs/examples/phpdoc/getNewGroups.php}
  761.      *
  762.      * @param mixed    $time 
  763.      * @param string    $distributions    (optional)
  764.      *
  765.      * @return mixed <br>
  766.      *   - (array)
  767.      *   - (object)    Pear_Error on failure
  768.      * @access public
  769.      */
  770.     function getNewGroups($time$distributions = null)
  771.     {
  772.         switch (true{
  773.             case is_integer($time):
  774.                 break;
  775.             case is_string($time):
  776.                 $time = (int) strtotime($time);
  777.                 break;
  778.             default:
  779.                 trigger_error('$time must be either a string or an integer!'E_USER_ERROR);
  780.         }
  781.  
  782.         return $this->cmdNewgroups($time$distributions);
  783.     }
  784.  
  785.     // }}}
  786.     // {{{ getNewArticles()
  787.  
  788.     /**
  789.      * Get new articles since a date.
  790.      *
  791.      * Returns a list of message-ids of new articles (since the specified date
  792.      * and time) in the groups whose names match the wildmat
  793.      *
  794.      * <b>Usage example:</b>
  795.      * {@example docs/examples/phpdoc/getNewArticles.php}
  796.      *
  797.      * @param mixed    $time 
  798.      * @param string    $groups    (optional)
  799.      * @param string    $distributions    (optional)
  800.      *
  801.      * @return mixed <br>
  802.      *   - (array)
  803.      *   - (object)    Pear_Error on failure
  804.      * @access public
  805.      * @since 1.3.0
  806.      */
  807.     function getNewArticles($time$groups '*'$distribution = null)
  808.     {
  809.         switch (true{
  810.             case is_integer($time):
  811.                 break;
  812.             case is_string($time):
  813.                 $time = (int) strtotime($time);
  814.                 break;
  815.             default:
  816.                 trigger_error('$time must be either a string or an integer!'E_USER_ERROR);
  817.         }
  818.  
  819.         return $this->cmdNewnews($time$groups$distribution);
  820.     }
  821.  
  822.     // }}}
  823.     // {{{ getGroups()
  824.  
  825.     /**
  826.      * Fetch valid groups.
  827.      *
  828.      * Returns a list of valid groups (that the client is permitted to select)
  829.      * and associated information.
  830.      *
  831.      * <b>Usage example:</b>
  832.      * {@example docs/examples/phpdoc/getGroups.php}
  833.      *
  834.      * @return mixed <br>
  835.      *   - (array)    Nested array with information about every valid group
  836.      *   - (object)    Pear_Error on failure
  837.      * @access public
  838.      * @see Net_NNTP_Client::getDescriptions()
  839.      * @see Net_NNTP_Client::selectGroup()
  840.      */
  841.     function getGroups($wildmat = null)
  842.     {
  843.         $backup = false;
  844.  
  845.         // Get groups
  846.         $groups $this->cmdListActive($wildmat);
  847.         if (PEAR::isError($groups)) {
  848.             switch ($groups->getCode()) {
  849.                 case 500:
  850.                 case 501:
  851.                     $backup = true;
  852.             break;
  853.             default:
  854.                     return $groups;
  855.             }
  856.         }
  857.  
  858.         // 
  859.         if ($backup == true{
  860.  
  861.             // 
  862.             if (!is_null($wildmat)) {
  863.                 return $this->throwError("The server does not support the 'LIST ACTIVE' command, and the 'LIST' command does not support the wildmat parameter!"nullnull);
  864.             }
  865.         
  866.             // 
  867.             $groups2 $this->cmdList();
  868.             if (PEAR::isError($groups2)) {
  869.             // Ignore...
  870.             else {
  871.                 $groups $groups2;
  872.             }
  873.     }
  874.  
  875.         if (PEAR::isError($groups)) {
  876.             return $groups;
  877.         }
  878.  
  879.         return $groups;
  880.     }
  881.  
  882.     // }}}
  883.     // {{{ getDescriptions()
  884.  
  885.     /**
  886.      * Fetch all known group descriptions.
  887.      *
  888.      * Fetches a list of known group descriptions - including groups which
  889.      * the client is not permitted to select.
  890.      *
  891.      * <b>Non-standard!</b><br>
  892.      * This method uses non-standard commands, which is not part
  893.      * of the original RFC977, but has been formalized in RFC2890.
  894.      *
  895.      * <b>Usage example:</b>
  896.      * {@example docs/examples/phpdoc/getDescriptions.php}
  897.      *
  898.      * @param mixed    $wildmat    (optional)
  899.      *
  900.      * @return mixed <br>
  901.      *   - (array)    Associated array with descriptions of known groups
  902.      *   - (object)    Pear_Error on failure
  903.      * @access public
  904.      * @see Net_NNTP_Client::getGroups()
  905.      */
  906.     function getDescriptions($wildmat = null)
  907.     {
  908.         if (is_array($wildmat)) {
  909.         $wildmat implode(','$wildmat);
  910.         }
  911.  
  912.         // Get group descriptions
  913.         $descriptions $this->cmdListNewsgroups($wildmat);
  914.         if (PEAR::isError($descriptions)) {
  915.             return $descriptions;
  916.         }
  917.  
  918.         // TODO: add xgtitle as backup
  919.     
  920.         return $descriptions;
  921.     }
  922.  
  923.     // }}}
  924.     // {{{ getOverview()
  925.  
  926.     /**
  927.      * Fetch an overview of article(s) in the currently selected group.
  928.      *
  929.      * Returns the contents of all the fields in the database for a number
  930.      * of articles specified by either article-numnber range, a message-id,
  931.      * or nothing (indicating currently selected article).
  932.      *
  933.      * The first 8 fields per article is always as follows:
  934.      *   - 'Number' - '0' or the article number of the currently selected group.
  935.      *   - 'Subject' - header content.
  936.      *   - 'From' - header content.
  937.      *   - 'Date' - header content.
  938.      *   - 'Message-ID' - header content.
  939.      *   - 'References' - header content.
  940.      *   - ':bytes' - metadata item.
  941.      *   - ':lines' - metadata item.
  942.      *
  943.      * The server may send more fields form it's database...
  944.      *
  945.      * <b>Non-standard!</b><br>
  946.      * This method uses non-standard commands, which is not part
  947.      * of the original RFC977, but has been formalized in RFC2890.
  948.      *
  949.      * <b>Usage example:</b>
  950.      * {@example docs/examples/phpdoc/getOverview.php}
  951.      *
  952.      * @param mixed    $range    (optional)
  953.      *                           - '<message number>'
  954.      *                           - '<message number>-<message number>'
  955.      *                           - '<message number>-'
  956.      *                           - '<message-id>'
  957.      * @param boolean    $_names    (optional) experimental parameter! Use field names as array kays
  958.      * @param boolean    $_forceNames    (optional) experimental parameter!
  959.      *
  960.      * @return mixed <br>
  961.      *   - (array)    Nested array of article overview data
  962.      *   - (object)    Pear_Error on failure
  963.      * @access public
  964.      * @see Net_NNTP_Client::getHeaderField()
  965.      * @see Net_NNTP_Client::getOverviewFormat()
  966.      */
  967.     function getOverview($range = null$_names = true$_forceNames = true)
  968.     {
  969.         // API v1.0
  970.         switch (true{
  971.         // API v1.3
  972.         case func_num_args(!= 2:
  973.         case is_bool(func_get_arg(1)):
  974.         case !is_int(func_get_arg(1)) || (is_string(func_get_arg(1)) && ctype_digit(func_get_arg(1))):
  975.         case !is_int(func_get_arg(0)) || (is_string(func_get_arg(0)) && ctype_digit(func_get_arg(0))):
  976.         break;
  977.  
  978.         default:
  979.                 // 
  980.                 trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: getOverview() !'E_USER_NOTICE);
  981.  
  982.                 // Fetch overview via API v1.3
  983.                 $overview $this->getOverview(func_get_arg(0'-' func_get_arg(1)truefalse);
  984.                 if (PEAR::isError($overview)) {
  985.                     return $overview;
  986.                 }
  987.  
  988.                 // Create and return API v1.0 compliant array
  989.                 $articles = array();
  990.                 foreach ($overview as $article{
  991.  
  992.                     // Rename 'Number' field into 'number'
  993.                     $article array_merge(array('number' => array_shift($article))$article);
  994.         
  995.                     // Use 'Message-ID' field as key
  996.                     $articles[$article['Message-ID']] $article;
  997.                 }
  998.                 return $articles;
  999.         }
  1000.  
  1001.         // Fetch overview from server
  1002.         $overview $this->cmdXOver($range);
  1003.         if (PEAR::isError($overview)) {
  1004.             return $overview;
  1005.         }
  1006.  
  1007.         // Use field names from overview format as keys?
  1008.         if ($_names{
  1009.  
  1010.             // Already cached?
  1011.             if (is_null($this->_overviewFormatCache)) {
  1012.                 // Fetch overview format
  1013.                 $format $this->getOverviewFormat($forceNamestrue);
  1014.                 if (PEAR::isError($format)){
  1015.                     return $format;
  1016.                 }
  1017.  
  1018.                 // Prepend 'Number' field
  1019.                 $format array_merge(array('Number' => false)$format);
  1020.  
  1021.                 // Cache format
  1022.                 $this->_overviewFormatCache $format;
  1023.  
  1024.             // 
  1025.             else {
  1026.                 $format $this->_overviewFormatCache;
  1027.             }
  1028.  
  1029.             // Loop through all articles
  1030.             foreach ($overview as $key => $article{
  1031.  
  1032.                 // Copy $format
  1033.                 $f $format;
  1034.  
  1035.                 // Field counter
  1036.                 $i = 0;
  1037.         
  1038.         // Loop through forld names in format
  1039.                 foreach ($f as $tag => $full{
  1040.  
  1041.                     //
  1042.                     $f[$tag$article[$i++];
  1043.  
  1044.                     // If prefixed by field name, remove it
  1045.                     if ($full === true{
  1046.                     $f[$tagltrimsubstr($f[$tag]strpos($f[$tag]':'+ 1)" \t");
  1047.                     }
  1048.                 }
  1049.  
  1050.                 // Replace article 
  1051.             $overview[$key$f;
  1052.             }
  1053.         }
  1054.  
  1055.         //
  1056.         switch (true{
  1057.  
  1058.             // Expect one article
  1059.             case is_null($range);
  1060.             case is_int($range);
  1061.             case is_string($range&& ctype_digit($range):
  1062.             case is_string($range&& substr($range01== '<' && substr($range-11== '>':
  1063.                 if (count($overview== 0{
  1064.                     return false;
  1065.                 else {
  1066.                     return reset($overview);
  1067.                 }
  1068.                 break;
  1069.  
  1070.             // Expect multiple articles
  1071.             default:
  1072.                 return $overview;
  1073.         }
  1074.     }
  1075.  
  1076.     // }}}
  1077.     // {{{ getOverviewFormat()
  1078.  
  1079.     /**
  1080.      * Fetch names of fields in overview database
  1081.      *
  1082.      * Returns a description of the fields in the database for which it is consistent.
  1083.      *
  1084.      * <b>Non-standard!</b><br>
  1085.      * This method uses non-standard commands, which is not part
  1086.      * of the original RFC977, but has been formalized in RFC2890.
  1087.      *
  1088.      * <b>Usage example:</b>
  1089.      * {@example docs/examples/phpdoc/getOveriewFormat.php}
  1090.      *
  1091.      * @return mixed <br>
  1092.      *   - (array)    Overview field names
  1093.      *   - (object)    Pear_Error on failure
  1094.      * @access public
  1095.      * @see Net_NNTP_Client::getOverview()
  1096.      */
  1097.     function getOverviewFormat($_forceNames = true$_full = false)
  1098.     {
  1099.         $format $this->cmdListOverviewFmt();
  1100.         if (PEAR::isError($format)) {
  1101.             return $format;
  1102.         }
  1103.  
  1104.         // Force name of first seven fields
  1105.         if ($_forceNames{
  1106.             array_splice($format07);
  1107.             $format array_merge(array('Subject'    => false,
  1108.                                         'From'       => false,
  1109.                                         'Date'       => false,
  1110.                                         'Message-ID' => false,
  1111.                                         'References' => false,
  1112.                                         ':bytes'     => false,
  1113.                                         ':lines'     => false)$format);
  1114.         }
  1115.  
  1116.         if ($_full{
  1117.             return $format;
  1118.         else {
  1119.             return array_keys($format);
  1120.         }
  1121.     }
  1122.  
  1123.     // }}}
  1124.     // {{{ getHeaderField()
  1125.  
  1126.     /**
  1127.      * Fetch content of a header field from message(s).
  1128.      *
  1129.      * Retreives the content of specific header field from a number of messages.
  1130.      *
  1131.      * <b>Non-standard!</b><br>
  1132.      * This method uses non-standard commands, which is not part
  1133.      * of the original RFC977, but has been formalized in RFC2890.
  1134.      *
  1135.      * <b>Usage example:</b>
  1136.      * {@example docs/examples/phpdoc/getHeaderField.php}
  1137.      *
  1138.      * @param string    $field    The name of the header field to retreive
  1139.      * @param mixed    $range    (optional)
  1140.      *                             '<message number>'
  1141.      *                             '<message number>-<message number>'
  1142.      *                             '<message number>-'
  1143.      *                             '<message-id>'
  1144.      *
  1145.      * @return mixed <br>
  1146.      *   - (array)    Nested array of
  1147.      *   - (object)    Pear_Error on failure
  1148.      * @access public
  1149.      * @see Net_NNTP_Client::getOverview()
  1150.      * @see Net_NNTP_Client::getReferences()
  1151.      */
  1152.     function getHeaderField($field$range = null)
  1153.     {
  1154.         $fields $this->cmdXHdr($field$range);
  1155.         if (PEAR::isError($fields)) {
  1156.             return $fields;
  1157.         }
  1158.  
  1159.         //
  1160.         switch (true{
  1161.  
  1162.             // Expect one article
  1163.             case is_null($range);
  1164.             case is_int($range);
  1165.             case is_string($range&& ctype_digit($range):
  1166.             case is_string($range&& substr($range01== '<' && substr($range-11== '>':
  1167.  
  1168.                 if (count($fields== 0{
  1169.                     return false;
  1170.                 else {
  1171.                     return reset($fields);
  1172.                 }
  1173.                 break;
  1174.  
  1175.             // Expect multiple articles
  1176.             default:
  1177.                 return $fields;
  1178.         }
  1179.     }
  1180.  
  1181.     // }}}
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.     // {{{ getGroupArticles()
  1190.  
  1191.     /**
  1192.      *
  1193.      *
  1194.      * <b>Non-standard!</b><br>
  1195.      * This method uses non-standard commands, which is not part
  1196.      * of the original RFC977, but has been formalized in RFC2890.
  1197.      *
  1198.      * <b>Usage example:</b>
  1199.      * {@example docs/examples/phpdoc/getGroupArticles.php}
  1200.      *
  1201.      * @param mixed    $range    (optional) Experimental!
  1202.      *
  1203.      * @return mixed <br>
  1204.      *   - (array)
  1205.      *   - (object)    Pear_Error on failure
  1206.      * @access public
  1207.      * @since 1.3.0
  1208.      */
  1209.     function getGroupArticles($range = null)
  1210.     {
  1211.         $summary $this->cmdListgroup();
  1212.         if (PEAR::isError($summary)) {
  1213.             return $summary;
  1214.         }
  1215.  
  1216.         // Update summary cache if group was also 'selected'
  1217.         if ($summary['group'!== null{
  1218.             $this->_selectedGroupSummary($summary);
  1219.         }
  1220.     
  1221.         //
  1222.         return $summary['articles'];
  1223.     }
  1224.  
  1225.     // }}}
  1226.     // {{{ getReferences()
  1227.  
  1228.     /**
  1229.      * Fetch reference header field of message(s).
  1230.      *
  1231.      * Retrieves the content of the references header field of messages via
  1232.      * either the XHDR ord the XROVER command.
  1233.      *
  1234.      * Identical to getHeaderField('References').
  1235.      *
  1236.      * <b>Non-standard!</b><br>
  1237.      * This method uses non-standard commands, which is not part
  1238.      * of the original RFC977, but has been formalized in RFC2890.
  1239.      *
  1240.      * <b>Usage example:</b>
  1241.      * {@example docs/examples/phpdoc/getReferences.php}
  1242.      *
  1243.      * @param mixed    $range    (optional)
  1244.      *                             '<message number>'
  1245.      *                             '<message number>-<message number>'
  1246.      *                             '<message number>-'
  1247.      *                             '<message-id>'
  1248.      *
  1249.      * @return mixed <br>
  1250.      *   - (array)    Nested array of references
  1251.      *   - (object)    Pear_Error on failure
  1252.      * @access public
  1253.      * @see Net_NNTP_Client::getHeaderField()
  1254.      */
  1255.     function getReferences($range = null)
  1256.     {
  1257.         $backup = false;
  1258.  
  1259.         $references $this->cmdXHdr('References'$range);
  1260.         if (PEAR::isError($references)) {
  1261.             switch ($references->getCode()) {
  1262.                 case 500:
  1263.                 case 501:
  1264.                     $backup = true;
  1265.             break;
  1266.             default:
  1267.                     return $references;
  1268.             }
  1269.         }
  1270.  
  1271.         if (true && (is_array($references&& count($references== 0)) {
  1272.             $backup = true;
  1273.         }
  1274.  
  1275.         if ($backup == true{
  1276.             $references2 $this->cmdXROver($range);
  1277.             if (PEAR::isError($references2)) {
  1278.             // Ignore...
  1279.             else {
  1280.                 $references $references2;
  1281.             }
  1282.     }
  1283.  
  1284.         if (PEAR::isError($references)) {
  1285.             return $references;
  1286.         }
  1287.  
  1288.         if (is_array($references)) {
  1289.             foreach ($references as $key => $val{
  1290.                 $references[$keypreg_split("/ +/"trim($val)-1PREG_SPLIT_NO_EMPTY);
  1291.             }
  1292.     }
  1293.  
  1294.         //
  1295.         switch (true{
  1296.  
  1297.             // Expect one article
  1298.             case is_null($range);
  1299.             case is_int($range);
  1300.             case is_string($range&& ctype_digit($range):
  1301.             case is_string($range&& substr($range01== '<' && substr($range-11== '>':
  1302.                 if (count($references== 0{
  1303.                     return false;
  1304.                 else {
  1305.                     return reset($references);
  1306.                 }
  1307.                 break;
  1308.  
  1309.             // Expect multiple articles
  1310.             default:
  1311.                 return $references;
  1312.         }
  1313.     }
  1314.  
  1315.     // }}}
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.     // {{{ count()
  1322.  
  1323.     /**
  1324.      * Number of articles in currently selected group
  1325.      *
  1326.      * <b>Usage example:</b>
  1327.      * {@example docs/examples/phpdoc/count.php}
  1328.      *
  1329.      * @return mixed <br>
  1330.      *   - (integer)    the number of article in group
  1331.      *   - (object)    Pear_Error on failure
  1332.      * @access public
  1333.      * @see Net_NNTP_Client::group()
  1334.      * @see Net_NNTP_Client::first()
  1335.      * @see Net_NNTP_Client::last()
  1336.      * @see Net_NNTP_Client::selectGroup()
  1337.      * @ignore
  1338.      */
  1339.     function count()
  1340.     {
  1341.         return $this->_selectedGroupSummary['count'];
  1342.     }
  1343.  
  1344.     // }}}
  1345.     // {{{ last()
  1346.  
  1347.     /**
  1348.      * Maximum article number in currently selected group
  1349.      *
  1350.      * <b>Usage example:</b>
  1351.      * {@example docs/examples/phpdoc/last.php}
  1352.      *
  1353.      * @return mixed <br>
  1354.      *   - (integer)    the last article's number
  1355.      *   - (object)    Pear_Error on failure
  1356.      * @access public
  1357.      * @see Net_NNTP_Client::first()
  1358.      * @see Net_NNTP_Client::group()
  1359.      * @see Net_NNTP_Client::count()
  1360.      * @see Net_NNTP_Client::selectGroup()
  1361.      * @ignore
  1362.      */
  1363.     function last()
  1364.     {
  1365.         return $this->_selectedGroupSummary['last'];
  1366.     }
  1367.  
  1368.     // }}}
  1369.     // {{{ first()
  1370.  
  1371.     /**
  1372.      * Minimum article number in currently selected group
  1373.      *
  1374.      * <b>Usage example:</b>
  1375.      * {@example docs/examples/phpdoc/first.php}
  1376.      *
  1377.      * @return mixed <br>
  1378.      *   - (integer)    the first article's number
  1379.      *   - (object)    Pear_Error on failure
  1380.      * @access public
  1381.      * @see Net_NNTP_Client::last()
  1382.      * @see Net_NNTP_Client::group()
  1383.      * @see Net_NNTP_Client::count()
  1384.      * @see Net_NNTP_Client::selectGroup()
  1385.      * @ignore
  1386.      */
  1387.     function first()
  1388.     {
  1389.         return $this->_selectedGroupSummary['first'];
  1390.     }
  1391.  
  1392.     // }}}
  1393.     // {{{ group()
  1394.  
  1395.     /**
  1396.      * Currently selected group
  1397.      *
  1398.      * <b>Usage example:</b>
  1399.      * {@example docs/examples/phpdoc/group.php}
  1400.      *
  1401.      * @return mixed <br>
  1402.      *   - (string)    group name
  1403.      *   - (object)    Pear_Error on failure
  1404.      * @access public
  1405.      * @see Net_NNTP_Client::first()
  1406.      * @see Net_NNTP_Client::last()
  1407.      * @see Net_NNTP_Client::count()
  1408.      * @see Net_NNTP_Client::selectGroup()
  1409.      * @ignore
  1410.      */
  1411.     function group()
  1412.     {
  1413.         return $this->_selectedGroupSummary['group'];
  1414.     }
  1415.  
  1416.     // }}}
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.     // {{{ isConnected()
  1425.  
  1426.     /**
  1427.      * Test whether a connection is currently open or closed.
  1428.      *
  1429.      * @return bool    True if connected, otherwise false
  1430.      * @access public
  1431.      * @see Net_NNTP_Client::connect()
  1432.      * @see Net_NNTP_Client::quit()
  1433.      * @deprecated    since v1.3.0 due to use of protected method: Net_NNTP_Protocol_Client::isConnected()
  1434.      * @ignore
  1435.      */
  1436.     function isConnected()
  1437.     {
  1438.     trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: isConnected() !'E_USER_NOTICE);
  1439.         return parent::_isConnected();
  1440.     }
  1441.  
  1442.     // }}}
  1443.     // {{{ getArticleRaw()
  1444.  
  1445.     /**
  1446.      * Deprecated alias for getArticle()
  1447.      *
  1448.      * @deprecated
  1449.      * @ignore
  1450.      */
  1451.     function getArticleRaw($article$implode = false)
  1452.     {
  1453.         trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: getArticleRaw() !'E_USER_NOTICE);
  1454.         return $this->getArticle($article$implode);
  1455.     }
  1456.  
  1457.     // }}}
  1458.     // {{{ getHeaderRaw()
  1459.  
  1460.     /**
  1461.      * Deprecated alias for getHeader()
  1462.      *
  1463.      * @deprecated
  1464.      * @ignore
  1465.      */
  1466.     function getHeaderRaw($article = null$implode = false)
  1467.     {
  1468.         trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: getHeaderRaw() !'E_USER_NOTICE);
  1469.         return $this->getHeader($article$implode);
  1470.     }
  1471.  
  1472.     // }}}
  1473.     // {{{ getBodyRaw()
  1474.  
  1475.     /**
  1476.      * Deprecated alias for getBody()
  1477.      *
  1478.      * @deprecated
  1479.      * @ignore
  1480.      */
  1481.     function getBodyRaw($article = null$implode = false)
  1482.     {
  1483.         trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: getBodyRaw() !'E_USER_NOTICE);
  1484.         return $this->getBody($article$implode);
  1485.     }
  1486.  
  1487.     // }}}
  1488.     // {{{ getNewNews()
  1489.  
  1490.     /**
  1491.      * Deprecated alias for getNewArticles()
  1492.      *
  1493.      * @deprecated
  1494.      * @ignore
  1495.      */
  1496.     function getNewNews($time$groups '*'$distribution = null)
  1497.     {
  1498.         trigger_error('You are using deprecated API v1.1 in Net_NNTP_Client: getNewNews() !'E_USER_NOTICE);
  1499.         return $this->getNewArticles($time$groups$distribution);
  1500.     }
  1501.  
  1502.     // }}}
  1503.     // {{{ getReferencesOverview()
  1504.  
  1505.     /**
  1506.      * Deprecated alias for getReferences()
  1507.      *
  1508.      * @deprecated
  1509.      * @ignore
  1510.      */
  1511.     function getReferencesOverview($first$last)
  1512.     {
  1513.     trigger_error('You are using deprecated API v1.0 in Net_NNTP_Client: getReferencesOverview() !'E_USER_NOTICE);
  1514.         return $this->getReferences($first '-' $last);
  1515.     }
  1516.  
  1517.     // }}}
  1518.  
  1519. }
  1520.  
  1521. // }}}
  1522.  
  1523. /*
  1524.  * Local variables:
  1525.  * tab-width: 4
  1526.  * c-basic-offset: 4
  1527.  * c-hanging-comment-ender-p: nil
  1528.  * End:
  1529.  */
  1530.  
  1531. ?>

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