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

Class: Net_NNTP_Protocol

Source Location: /Net_NNTP-0.10.0/NNTP/Protocol.php

Class Overview

PEAR
   |
   --Net_NNTP_Protocol

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


Author(s):

Version:

  • 0.0.1

Methods


Child classes:

Net_NNTP
The Net_NNTP class is an almost 100 % backward compatible frontend class to the Net_NNTP_Protocol class.
Net_NNTP_Realtime
The Net_NNTP_Realtime class is a frontend class to the Net_NNTP_Protocol class. It does everything in realtime...

Inherited Variables

Inherited Methods


Class Details

[line 76]
The Net_NNTP_Protocol class implements the NNTP standard acording to RFX 977, RFC 2980, RFC 850/1036 , and RFC 822/2822


[ Top ]


Method Detail

Net_NNTP_Protocol (Constructor)   [line 102]

Net_NNTP_Protocol Net_NNTP_Protocol( )


[ Top ]

cmdArticle   [line 327]

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 422]

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 937]

mixed cmdDate( [mixed $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.

[ Top ]

cmdGroup   [line 537]

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 375]

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 571]

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 872]

mixed cmdListgroup( mixed $newsgroup, string $newsgroup )

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

Parameters:

string   $newsgroup      

[ Top ]

cmdListNewsgroups   [line 610]

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 725]

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 297]

mixed cmdModeReader( )

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

[ Top ]

cmdNewgroups   [line 692]

mixed cmdNewgroups( int $time)

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).

[ Top ]

cmdNewnews   [line 904]

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


[ Top ]

cmdPost   [line 479]

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 176]

void cmdQuit( )

Close connection to the server
  • Access: public

[ Top ]

cmdXGTitle   [line 650]

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 771]

mixed cmdXOver( integer $first, integer $last)

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:

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

[ Top ]

cmdXROver   [line 825]

mixed cmdXROver( integer $first, integer $last)

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:

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

[ Top ]

connect   [line 120]

mixed connect( [optional $host = NET_NNTP_PROTOCOL_DEFAULT_HOST], [optional $port = NET_NNTP_PROTOCOL_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::connect()
Connect to the newsserver.
Net_NNTP_Realtime::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 163]

void disconnect( )

alias for cmdQuit()
  • Access: public

[ Top ]

isConnected   [line 967]

bool isConnected( )

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

Overridden in child classes as:

Net_NNTP::isConnected()
Test whether we are connected or not.
Net_NNTP_Realtime::isConnected()
Test whether a connection is currently open.

[ Top ]

setDebug   [line 983]

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 Sat, 1 May 2004 00:56:20 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.