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

Class: Net_NNTP_Protocol_Client

Source Location: /Net_NNTP-1.1.1/NNTP/Protocol/Client.php

Class Overview


The Net_NNTP_Protocol_Client class implements the NNTP standard acording to RFX 977, RFC 2980, RFC 850/1036, and RFC 822/2822


Author(s):

Version:

  • $Id: Client.php,v 1.3 2005/01/14 15:29:08 heino Exp $

Methods


Child classes:

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

Inherited Variables

Inherited Methods


Class Details

[line 86]
The Net_NNTP_Protocol_Client class implements the NNTP standard acording to RFX 977, RFC 2980, RFC 850/1036, and RFC 822/2822
  • Author: Heino H. Gehlsen <heino@gehlsen.dk>
  • Version: $Id: Client.php,v 1.3 2005/01/14 15:29:08 heino Exp $
  • See: Net_NNTP_Client
  • Since: Class available since Release 0.11.0
  • Access: public


[ Top ]


Method Detail

Net_NNTP_Protocol_Client (Constructor)   [line 120]

Net_NNTP_Protocol_Client Net_NNTP_Protocol_Client( )


[ Top ]

cmdArticle   [line 341]

mixed cmdArticle( mixed $article)

Get an article from the currently open connection.
  • Return: (array) article on success or (object) pear_error on failure
  • Access: public

Parameters:

mixed   $article   —  Either a message-id or a message-number of the article to fetch. If null or '', then use current article.

[ Top ]

cmdBody   [line 435]

mixed cmdBody( mixed $article)

Get the body of an article from the currently open connection.
  • Return: (array) body on success or (object) pear_error on failure
  • Access: public

Parameters:

mixed   $article   —  Either a message-id or a message-number of the article to fetch the body from. If null or '', then use current article.

[ Top ]

cmdDate   [line 967]

mixed cmdDate( [ $timestamp = false], bool $timestap)

Get the date from the newsserver format of returned date
  • Return: (string) 'YYYYMMDDhhmmss' / (int) timestamp on success or (object) pear_error on failure
  • Access: public

Parameters:

bool   $timestap   —  when false function returns string, and when true function returns int/timestamp.
   $timestamp   — 

[ Top ]

cmdGroup   [line 550]

mixed cmdGroup( string $newsgroup)

Selects a news group (issue a GROUP command to the server)
  • Return: (array) groupinfo on success or (object) pear_error on failure
  • Access: public

Parameters:

string   $newsgroup   —  The newsgroup name

[ Top ]

cmdHead   [line 388]

mixed cmdHead( mixed $article)

Get the headers of an article from the currently open connection.
  • Return: (array) headers on success or (object) pear_error on failure
  • Access: public

Parameters:

mixed   $article   —  Either a message-id or a message-number of the article to fetch the headers from. If null or '', then use current article.

[ Top ]

cmdList   [line 586]

mixed cmdList( )

Fetches a list of all avaible newsgroups
  • Return: (array) nested array with informations about existing newsgroups on success or (object) pear_error on failure
  • Access: public

[ Top ]

cmdListgroup   [line 902]

mixed cmdListgroup( string $newsgroup)

  • Return: (array) on success or (object) pear_error on failure

Parameters:

string   $newsgroup   — 

[ Top ]

cmdListNewsgroups   [line 628]

mixed cmdListNewsgroups( [string $wildmat = ''])

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
  • Access: public

Parameters:

string   $wildmat   —  Wildmat of the groups, that is to be listed, defaults to '';

[ Top ]

cmdListOverviewFmt   [line 747]

mixed cmdListOverviewFmt( )

Returns a list of avaible headers which are send from newsserver to client for every news message
  • Return: (array) of header names on success or (object) pear_error on failure
  • Access: public

[ Top ]

cmdModeReader   [line 312]

mixed cmdModeReader( )

  • Return: (bool) true when one can post on success or (object) pear_error on failure
  • Access: public

[ Top ]

cmdNewgroups   [line 714]

mixed cmdNewgroups( int $time, [optional $distributions = null])

Fetches a list of all newsgroups created since a specified date.
  • Return: (array) nested array with informations about existing newsgroups on success or (object) pear_error on failure
  • Access: public

Parameters:

int   $time   —  Last time you checked for groups (timestamp).
optional   $distributions   —  string $distributions

[ Top ]

cmdNewnews   [line 934]

void cmdNewnews( $time, [ $newsgroups = '*'])


Parameters:

   $time   — 
   $newsgroups   — 

[ Top ]

cmdPost   [line 492]

mixed cmdPost( string $newsgroup, string $subject, string $body, string $from, [optional $aditional = ''])

Post an article to a newsgroup.

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

  • Return: (bool) true on success or (object) pear_error on failure
  • Access: public

Parameters:

string   $newsgroup   —  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 ]

cmdQuit   [line 192]

void cmdQuit( )

Close connection to the server
  • Access: public

[ Top ]

cmdXGTitle   [line 672]

mixed cmdXGTitle( [string $wildmat = '*'])

Fetches a list of (all) avaible newsgroup descriptions.

Depresated as of RFC2980.

  • Return: (array) nested array with description of existing newsgroups on success or (object) pear_error on failure
  • Access: public

Parameters:

string   $wildmat   —  Wildmat of the groups, that is to be listed, defaults to '*';

[ Top ]

cmdXOver   [line 792]

mixed cmdXOver( string $range)

Fetch message header from message number $first until $last

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

  • Return: (array) nested array of message and there headers on success or (object) pear_error on failure
  • Access: public

Parameters:

string   $range   —  articles to fetch

[ Top ]

cmdXROver   [line 850]

mixed cmdXROver( string $range)

Fetch message references from message number $first to $last
  • Return: (array) assoc. array of message references on success or (object) pear_error on failure
  • Access: public

Parameters:

string   $range   —  articles to fetch

[ Top ]

connect   [line 136]

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

Connect to the server
  • Return: (bool) true on success or (object) pear_error on failure
  • Access: public

Overridden in child classes as:

Net_NNTP_Client::connect()
Connect to the NNTP-server.

Parameters:

optional   $host   —  string $host The adress of the NNTP-server to connect to, defaults to 'localhost'.
optional   $port   —  int $port The port number to connect to, defaults to 119.

[ Top ]

disconnect   [line 179]

void disconnect( )

alias for cmdQuit()
  • Access: public

[ Top ]

isConnected   [line 997]

bool isConnected( )

Test whether we are connected or not.
  • Return: true or false
  • Access: public

Overridden in child classes as:

Net_NNTP_Client::isConnected()
Test whether a connection is currently open.

[ Top ]

setDebug   [line 1013]

bool setDebug( [boolean $debug = true])

Sets the debuging information on or off
  • Return: previos state
  • Access: public

Parameters:

boolean   $debug   —  True or false

[ Top ]


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