Net_NNTP_Client (Constructor) [line 124]
Net_NNTP_Client Net_NNTP_Client(
)
Constructor
Usage example:
authenticate [line 220]
mixed authenticate(
string
$user, string
$pass)
Authenticate.
xxx
Non-standard!
This method uses non-standard commands, which is not part of the original RFC977, but has been formalized in RFC2890.
Usage example:
- Return:
- (bool) True on successful authentification, otherwise false
- (object) Pear_Error on failure
- See: Net_NNTP_Client::connect()
- Access: public
Parameters:
string
$user
—
The username
string
$pass
—
The password
connect [line 152]
mixed connect(
[string
$host = null], [mixed
$encryption = null], [int
$port = null], [int
$timeout = null])
Connect to a server.
xxx
Usage example:
Parameters:
string
$host
—
(optional) The hostname og IP-address of the NNTP-server to connect to, defaults to localhost.
mixed
$encryption
—
(optional) false|'tls'|'ssl', defaults to false.
int
$port
—
(optional) The port number to connect to, defaults to 119 or 563 dependng on $encryption.
int
$timeout
—
(optional)
disconnect [line 176]
getArticle [line 456]
mixed getArticle(
[mixed
$article = null], [bool
$implode = false])
Fetch article into transfer object.
Select an article based on the arguments, and return the entire article (raw data).
Usage example:
Parameters:
mixed
$article
—
(optional) Either the message-id or the message-number on the server of the article to fetch.
bool
$implode
—
(optional) When true the result array is imploded to a string, defaults to false.
getBody [line 574]
mixed getBody(
[mixed
$article = null], [bool
$implode = false])
Fetch article body.
Select an article based on the arguments, and return the article body (raw data).
Usage example:
Parameters:
mixed
$article
—
(optional) Either the message-id or the message-number on the server of the article to fetch.
bool
$implode
—
(optional) When true the result array is imploded to a string, defaults to false.
getDate [line 735]
mixed getDate(
[int
$format = 1])
Get the server's internal date
Non-standard!
This method uses non-standard commands, which is not part of the original RFC977, but has been formalized in RFC2890.
Usage example:
- Return:
- (mixed)
- (object) Pear_Error on failure
- Access: public
Parameters:
int
$format
—
(optional) Determines the format of returned date:
- 0: return string
- 1: return integer/timestamp
- 2: return an array('y'=>year, 'm'=>month,'d'=>day)
getDescriptions [line 925]
mixed getDescriptions(
[mixed
$wildmat = null])
Fetch all known group descriptions.
Fetches a list of known group descriptions - including groups which the client is not permitted to select.
Non-standard!
This method uses non-standard commands, which is not part of the original RFC977, but has been formalized in RFC2890.
Usage example:
- Return:
- (array) Associated array with descriptions of known groups
- (object) Pear_Error on failure
- See: Net_NNTP_Client::getGroups()
- Access: public
Parameters:
mixed
$wildmat
—
(optional)
getGroupArticles [line 1228]
mixed getGroupArticles(
[mixed
$range = null])
Non-standard! This method uses non-standard commands, which is not part of the original RFC977, but has been formalized in RFC2890.
Usage example:
- Return:
- (array)
- (object) Pear_Error on failure
- Since: 1.3.0
- Access: public
Parameters:
mixed
$range
—
(optional) Experimental!
getGroups [line 860]
mixed getGroups(
[
$wildmat = null])
Fetch valid groups.
Returns a list of valid groups (that the client is permitted to select) and associated information.
Usage example:
Parameters:
getHeader [line 515]
mixed getHeader(
[mixed
$article = null], [bool
$implode = false])
Fetch article header.
Select an article based on the arguments, and return the article header (raw data).
Usage example:
Parameters:
mixed
$article
—
(optional) Either message-id or message number of the article to fetch.
bool
$implode
—
(optional) When true the result array is imploded to a string, defaults to false.
getHeaderField [line 1171]
mixed getHeaderField(
string
$field, [mixed
$range = null])
Fetch content of a header field from message(s).
Retreives the content of specific header field from a number of messages.
Non-standard!
This method uses non-standard commands, which is not part of the original RFC977, but has been formalized in RFC2890.
Usage example:
Parameters:
string
$field
—
The name of the header field to retreive
mixed
$range
—
(optional) '<message number>' '<message number>-<message number>' '<message number>-' '<message-id>'
getNewArticles [line 823]
mixed getNewArticles(
mixed
$time, [string
$groups = '*'], [
$distribution = null], string
$distributions)
Get new articles since a date.
Returns a list of message-ids of new articles (since the specified date and time) in the groups whose names match the wildmat
Usage example:
- Return:
- (array)
- (object) Pear_Error on failure
- Since: 1.3.0
- Access: public
Parameters:
mixed
$time
—
- (integer) A timestamp
- (string) Somthing parseable by strtotime() like '-1 week'
string
$groups
—
(optional)
string
$distributions
—
(optional)
$distribution
—
getNewGroups [line 781]
mixed getNewGroups(
mixed
$time, [string
$distributions = null])
Get new groups since a date.
Returns a list of groups created on the server since the specified date and time.
Usage example:
- Return:
- (array)
- (object) Pear_Error on failure
- Access: public
Parameters:
mixed
$time
—
- (integer) A timestamp
- (string) Somthing parseable by strtotime() like '-1 week'
string
$distributions
—
(optional)
getOverview [line 986]
mixed getOverview(
[mixed
$range = null], [boolean
$_names = true], [boolean
$_forceNames = true])
Fetch an overview of article(s) in the currently selected group.
Returns the contents of all the fields in the database for a number of articles specified by either article-numnber range, a message-id, or nothing (indicating currently selected article).
The first 8 fields per article is always as follows:
- 'Number' - '0' or the article number of the currently selected group.
- 'Subject' - header content.
- 'From' - header content.
- 'Date' - header content.
- 'Message-ID' - header content.
- 'References' - header content.
- ':bytes' - metadata item.
- ':lines' - metadata item.
The server may send more fields form it's database...
Non-standard!
This method uses non-standard commands, which is not part of the original RFC977, but has been formalized in RFC2890.
Usage example:
Parameters:
mixed
$range
—
(optional)
- '<message number>'
- '<message number>-<message number>'
- '<message number>-'
- '<message-id>'
boolean
$_names
—
(optional) experimental parameter! Use field names as array kays
boolean
$_forceNames
—
(optional) experimental parameter!
getOverviewFormat [line 1116]
mixed getOverviewFormat(
[
$_forceNames = true], [
$_full = false])
Fetch names of fields in overview database
Returns a description of the fields in the database for which it is consistent.
Non-standard!
This method uses non-standard commands, which is not part of the original RFC977, but has been formalized in RFC2890.
Usage example:
Parameters:
getReferences [line 1274]
mixed getReferences(
[mixed
$range = null])
Fetch reference header field of message(s).
Retrieves the content of the references header field of messages via either the XHDR ord the XROVER command.
Identical to getHeaderField('References').
Non-standard!
This method uses non-standard commands, which is not part of the original RFC977, but has been formalized in RFC2890.
Usage example:
Parameters:
mixed
$range
—
(optional) '<message number>' '<message number>-<message number>' '<message number>-' '<message-id>'
mail [line 691]
mixed mail(
string
$groups, string
$subject, string
$body, [string
$additional = null])
Post an article to a number of groups - using same parameters as PHP's mail() function.
Among the aditional headers you might think of adding could be: "From: <author-email-address>", which should contain the e-mail address of the author of the article. Or "Organization: <org>" which contain the name of the organization the post originates from. Or "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.
Usage example:
- Return:
- (string) Server response
- (object) Pear_Error on failure
- Access: public
Parameters:
string
$groups
—
The groups to post to.
string
$subject
—
The subject of the article.
string
$body
—
The body of the article.
string
$additional
—
(optional) Additional header fields to send.
selectArticle [line 406]
mixed selectArticle(
[mixed
$article = null], [int
$_ret = 0])
Selects an article by article message-number.
xxx
Usage example:
Parameters:
mixed
$article
—
The message-number (on the server) of the article to select as current article.
int
$_ret
—
(optional) Experimental
selectGroup [line 260]
mixed selectGroup(
string
$group, [mixed
$articles = false])
Selects a group.
Moves the servers 'currently selected group' pointer to the group a new group, and returns summary information about it.
Non-standard!
When using the second parameter, This method uses non-standard commands, which is not part of the original RFC977, but has been formalized in RFC2890.
Usage example:
- Return:
- (array) Summary about the selected group
- (object) Pear_Error on failure
- See: Net_NNTP_Client::last()
- See: Net_NNTP_Client::count()
- See: Net_NNTP_Client::first()
- See: Net_NNTP_Client::group()
- See: Net_NNTP_Client::getGroups()
- Access: public
Parameters:
string
$group
—
Name of the group to select
mixed
$articles
—
(optional) experimental! When true the article numbers is returned in 'articles'
selectNextArticle [line 360]
mixed selectNextArticle(
[int
$_ret = 0])
Select the next article.
Select the next article in current group.
Usage example:
Parameters:
int
$_ret
—
(optional) Experimental
selectPreviousArticle [line 314]
mixed selectPreviousArticle(
[int
$_ret = 0])
Select the previous article.
Select the previous article in current group.
Usage example:
Parameters:
int
$_ret
—
(optional) Experimental