[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
Net_NNTP_Protocol_Client (Constructor) [line 120]
Net_NNTP_Protocol_Client Net_NNTP_Protocol_Client(
)
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.
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.
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
—
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
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.
cmdList [line 586]
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
cmdListgroup [line 902]
mixed cmdListgroup(
string
$newsgroup)
- Return: (array) on success or (object) pear_error on failure
Parameters:
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 '';
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
cmdModeReader [line 312]
- Return: (bool) true when one can post on success or (object) pear_error on failure
- Access: public
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
cmdNewnews [line 934]
void cmdNewnews(
$time, [
$newsgroups = '*'])
Parameters:
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.
cmdQuit [line 192]
Close connection to the server
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 '*';
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
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
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.
disconnect [line 179]
isConnected [line 997]
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.
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