Net_NNTP
[ class tree: Net_NNTP ] [ index: Net_NNTP ] [ all elements ]

Class: Net_NNTP_Client

Source Location: /Net_NNTP-1.2.5/NNTP/Client.php

Class Overview

Net_NNTP_Protocol_Client
   |
   --Net_NNTP_Client

Implementation of the client side of NNTP (Network News Transfer Protocol)


Author(s):

Version:

  • $Id: Client.php,v 1.5.2.7 2005/11/27 22:47:13 heino Exp $

Methods


Inherited Variables

Inherited Methods


Class Details

[line 91]
Implementation of the client side of NNTP (Network News Transfer Protocol)

The Net_NNTP_Client class is a frontend class to the Net_NNTP_Protocol_Client class.

  • Author: Heino H. Gehlsen <heino@gehlsen.dk>
  • Version: $Id: Client.php,v 1.5.2.7 2005/11/27 22:47:13 heino Exp $
  • See: Net_NNTP_Protocol_Client
  • Since: Class available since Release 0.11.0
  • Access: public


[ Top ]


Method Detail

Net_NNTP_Client (Constructor)   [line 112]

Net_NNTP_Client Net_NNTP_Client( )

Constructor
  • Access: public

[ Top ]

authenticate   [line 170]

mixed authenticate( string $user, optional $pass, [optional $mode = NET_NNTP_CLIENT_AUTH_ORIGINAL])

Authenticate

Experimental / Partially implemented

Auth process (not yet standarized but used any way) http://www.mibsoftware.com/userkt/nntpext/index.html


Parameters:

string   $user   —  The username
optional   $pass   —  string $pass The password
optional   $mode   —  string $mode The authentication mode (original, simple, generic).

[ Top ]

connect   [line 131]

mixed connect( [optional $host = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_HOST], [optional $port = NET_NNTP_PROTOCOL_CLIENT_DEFAULT_PORT])

Connect to the NNTP-server.

Parameters:

optional   $host   —  string $host The adress of the NNTP-server to connect to.
optional   $port   —  int $port The port to connect to.

[ Top ]

count   [line 836]

integer count( )

Number of articles in currently selected group

[ Top ]

first   [line 874]

integer first( )

Minimum article number in currently selected group

[ Top ]

getArticle   [line 533]

mixed getArticle( mixed $article, [ $class = 'Net_NNTP_Message'], [ $implode = false])

Selects an article based on the arguments and returns the entire article.

Experimental

The v0.2 version of the this function (which returned the article as a string) has been renamed to getArticleRaw().


Parameters:

mixed   $article   —  Either the message-id or the message-number on the server of the article to fetch.
   $class   — 
   $implode   — 

[ Top ]

getArticleRaw   [line 568]

mixed getArticleRaw( mixed $article, [optional $implode = false])

Selects an article based on the arguments and returns the entire article (raw data)

Parameters:

mixed   $article   —  Either the message-id or the message-number on the server of the article to fetch.
optional   $implode   —  bool $implode When true the result array is imploded to a string, defaults to false.

[ Top ]

getBody   [line 663]

mixed getBody( mixed $article, $class, [ $implode = false])

Selects an article based on the arguments and returns the article body

Experimental


Parameters:

mixed   $article   —  Either the (string) message-id or the (int) message-number on the server of the article to fetch.
   $class   — 
   $implode   — 

[ Top ]

getBodyRaw   [line 698]

mixed getBodyRaw( mixed $article, [optional $implode = false])

Selects an article based on the arguments and returns the article body (raw data)

Parameters:

mixed   $article   —  Either the message-id or the message-number on the server of the article to fetch.
optional   $implode   —  bool $implode When true the result array is imploded to a string, defaults to false.

[ Top ]

getDate   [line 803]

mixed getDate( [optional $format = 1])

Get the NNTP-server's internal date

Get the date from the newsserver format of returned date:

  • Return: (mixed) date on success or (object) pear_error on failure
  • Since: 0.3
  • Access: public

Parameters:

optional   $format   —  int $format
  • 0: $date - timestamp
  • 1: $date['y'] - year $date['m'] - month $date['d'] - day

[ Top ]

getDescriptions   [line 270]

mixed getDescriptions( )

Fetches a list of all avaible newsgroup descriptions.
  • Return: (array) nested array with description of existing newsgroups on success or (object) pear_error on failure
  • See: Net_NNTP_Client::getGroups()
  • Access: public

[ Top ]

getGroupArticles   [line 724]

mixed getGroupArticles( $newsgroup)

Selects a group in the same manner as the the selectGroup method, but also provides a list of article numbers in the group

Experimental

  • Return: (array) on success or (object) pear_error on failure
  • Since: 0.3
  • Access: public

Parameters:

   $newsgroup   — 

[ Top ]

getGroups   [line 249]

mixed getGroups( )

Returns a list of valid newsgroups and associated information

[ Top ]

getHeader   [line 598]

mixed getHeader( mixed $article, [ $class = 'Net_NNTP_Header'], [ $implode = false])

Selects an article based on the arguments and returns the article header

Experimental


Parameters:

mixed   $article   —  Either the (string) message-id or the (int) message-number on the server of the article to fetch.
   $class   — 
   $implode   — 

[ Top ]

getHeaderField   [line 388]

mixed getHeaderField( stringr $field, integer $first, integer $last)

Fetch a header field from a number of message.

Experimental


Parameters:

stringr   $field   — 
integer   $first   —  first article to fetch
integer   $last   —  last article to fetch

[ Top ]

getHeaderRaw   [line 633]

mixed getHeaderRaw( mixed $article, [optional $implode = false])

Selects an article based on the arguments and returns the article header (raw data)

Parameters:

mixed   $article   —  Either the (string) message-id or the (int) message-number on the server of the article to fetch.
optional   $implode   —  bool $implode When true the result array is imploded to a string, defaults to false.

[ Top ]

getNewGroups   [line 743]

mixed getNewGroups( $time, [ $distributions = null])

Returns a list of newsgroups created on the server since the specified date and time

Experimental

  • Return: (array) on success or (object) pear_error on failure
  • Since: 0.3
  • Access: public

Parameters:

   $time   — 
   $distributions   — 

[ Top ]

getNewNews   [line 770]

mixed getNewNews( $time, [ $newsgroups = '*'], [ $distribution = null])

Returns a list of message-ids of new articles (since the specified date and time) in the groups whose names match the wildmat

Experimental

  • Return: (array) on success or (object) pear_error on failure
  • Since: 0.3
  • Access: public

Parameters:

   $time   — 
   $newsgroups   — 
   $distribution   — 

[ Top ]

getOverview   [line 298]

mixed getOverview( integer $first, integer $last)

Returns the contents of all the fields in the database for an article specified by message-id, or from a specified article, or range of articles in the currently selected newsgroup

The format of the returned array is: $messages[message_id][header_name]


Parameters:

integer   $first   —  first article to fetch
integer   $last   —  last article to fetch

[ Top ]

getOverviewFormat   [line 320]

mixed getOverviewFormat( )

Returns a description of the fields in the database for which it is consistent

[ Top ]

getReferencesOverview   [line 348]

mixed getReferencesOverview( integer $first, integer $last)

Fetch a list of each message's reference header field.

Parameters:

integer   $first   —  first article to fetch
integer   $last   —  last article to fetch

[ Top ]

group   [line 893]

string group( )

Currently selected group

[ Top ]

isConnected   [line 204]

bool isConnected( )

Test whether a connection is currently open.

[ Top ]

last   [line 855]

integer last( )

Maximum article number in currently selected group

[ Top ]

post   [line 421]

mixed post( string $newsgroups, string $subject, string $body, string $from, [optional $aditional = null])

Post an article to a number of newsgroups.

(Among the aditional headers you might think of adding could be: "NNTP-Posting-Host: <ip-of-author>", which should contain the IP-address of the author of the post, so the message can be traced back to him. Or "Organization: <org>" which contain the name of the organization the post originates from)

  • Return: (string) server response on success or (object) pear_error on failure
  • Access: public

Parameters:

string   $newsgroups   —  The newsgroup to post to.
string   $subject   —  The subject of the post.
string   $body   —  The body of the post itself.
string   $from   —  Name + email-adress of sender.
optional   $aditional   —  string $aditional Aditional headers to send.

[ Top ]

quit   [line 146]

void quit( )

Close connection to the server

[ Top ]

selectArticle   [line 439]

mixed selectArticle( int $article)

Selects an article by article message-number

Parameters:

int   $article   —  The message-number (on the server) of the article to select as current article.

[ Top ]

selectGroup   [line 225]

mixed selectGroup( string $group)

Selects a newsgroup as the currently selected newsgroup and returns summary information about it

Parameters:

string   $group   —  Newsgroup name

[ Top ]

selectNextArticle   [line 468]

mixed selectNextArticle( )

Select the next article in current group

[ Top ]

selectPreviousArticle   [line 497]

mixed selectPreviousArticle( )

Select the previous article in current group

[ Top ]


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