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

Class: Net_NNTP_Client

Source Location: /Net_NNTP-1.1.1/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.4.2.5 2005/03/28 16:33:17 heino Exp $

Methods


Inherited Variables

Inherited Methods

Class: Net_NNTP_Protocol_Client

Net_NNTP_Protocol_Client::Net_NNTP_Protocol_Client()
Net_NNTP_Protocol_Client::cmdArticle()
Get an article from the currently open connection.
Net_NNTP_Protocol_Client::cmdBody()
Get the body of an article from the currently open connection.
Net_NNTP_Protocol_Client::cmdDate()
Get the date from the newsserver format of returned date
Net_NNTP_Protocol_Client::cmdGroup()
Selects a news group (issue a GROUP command to the server)
Net_NNTP_Protocol_Client::cmdHead()
Get the headers of an article from the currently open connection.
Net_NNTP_Protocol_Client::cmdList()
Fetches a list of all avaible newsgroups
Net_NNTP_Protocol_Client::cmdListgroup()
Net_NNTP_Protocol_Client::cmdListNewsgroups()
Fetches a list of (all) avaible newsgroup descriptions.
Net_NNTP_Protocol_Client::cmdListOverviewFmt()
Returns a list of avaible headers which are send from newsserver to client for every news message
Net_NNTP_Protocol_Client::cmdModeReader()
Net_NNTP_Protocol_Client::cmdNewgroups()
Fetches a list of all newsgroups created since a specified date.
Net_NNTP_Protocol_Client::cmdNewnews()
Net_NNTP_Protocol_Client::cmdPost()
Post an article to a newsgroup.
Net_NNTP_Protocol_Client::cmdQuit()
Close connection to the server
Net_NNTP_Protocol_Client::cmdXGTitle()
Fetches a list of (all) avaible newsgroup descriptions.
Net_NNTP_Protocol_Client::cmdXOver()
Fetch message header from message number $first until $last
Net_NNTP_Protocol_Client::cmdXROver()
Fetch message references from message number $first to $last
Net_NNTP_Protocol_Client::connect()
Connect to the server
Net_NNTP_Protocol_Client::disconnect()
alias for cmdQuit()
Net_NNTP_Protocol_Client::isConnected()
Test whether we are connected or not.
Net_NNTP_Protocol_Client::setDebug()
Sets the debuging information on or off

Class Details

[line 89]
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.



[ Top ]


Method Detail

Net_NNTP_Client (Constructor)   [line 110]

Net_NNTP_Client Net_NNTP_Client( )

Constructor
  • Access: public

[ Top ]

authenticate   [line 166]

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

Authenticate

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

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

Connect to the NNTP-server.

Overrides Net_NNTP_Protocol_Client::connect() (Connect to the 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 573]

integer count( )

Number of articles in currently selected group

[ Top ]

first   [line 611]

integer first( )

Minimum article number in currently selected group

[ Top ]

getArticleRaw   [line 383]

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

Get a 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 ]

getBodyRaw   [line 446]

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

Get the body of an 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 ]

getDate   [line 540]

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

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

void getGroupArticles( $newsgroup)

Experimental
  • Since: 0.3
  • Access: public

Parameters:

   $newsgroup   — 

[ Top ]

getGroups   [line 245]

mixed getGroups( )

Fetches a list of all avaible newsgroups

[ Top ]

getHeaderRaw   [line 412]

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

Get the header of an article (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 483]

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

Experimental
  • Since: 0.3
  • Access: public

Parameters:

   $time   — 
   $distributions   — 

[ Top ]

getNewNews   [line 507]

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

Experimental
  • Since: 0.3
  • Access: public

Parameters:

   $time   — 
   $newsgroups   — 

[ Top ]

getOverview   [line 294]

mixed getOverview( integer $first, integer $last)

Fetch message header fields from message number $first to $last

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

mixed getOverviewFormat( )

Returns a list of avaible headers which are send from NNTP-server to the client for every news message

[ Top ]

getReferencesOverview   [line 332]

mixed getReferencesOverview( integer $first, integer $last)

Fetch a list of each message's reference header.

Parameters:

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

[ Top ]

group   [line 630]

string group( )

Currently selected group

[ Top ]

isConnected   [line 200]

bool isConnected( )

Test whether a connection is currently open.

Overrides Net_NNTP_Protocol_Client::isConnected() (Test whether we are connected or not.)
[ Top ]

last   [line 592]

integer last( )

Maximum article number in currently selected group

[ Top ]

post   [line 363]

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

void quit( )

Close connection to the newsserver

[ Top ]

selectGroup   [line 221]

mixed selectGroup( string $newsgroup)

Selects a newsgroup

Parameters:

string   $newsgroup   —  Newsgroup name

[ Top ]


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