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

Class: Net_NNTP_Realtime

Source Location: /Net_NNTP-0.10.2/NNTP/Realtime.php

Class Overview

Net_NNTP_Protocol
   |
   --Net_NNTP_Realtime

The Net_NNTP_Realtime class is a frontend class to the Net_NNTP_Protocol class. It does everything in realtime...


Author(s):

Version:

  • 0.0.1

Methods


Inherited Variables

Inherited Methods

Class: Net_NNTP_Protocol

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

Class Details

[line 78]
The Net_NNTP_Realtime class is a frontend class to the Net_NNTP_Protocol class. It does everything in realtime...


[ Top ]


Method Detail

Net_NNTP_Realtime (Constructor)   [line 97]

Net_NNTP_Realtime Net_NNTP_Realtime( )

Constructor

[ Top ]

authenticate   [line 196]

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

Authenticate

Auth process (not yet standarized but used any way) http://www.mibsoftware.com/userkt/nntpext/index.html

  • Return: (bool) true on success or (object) pear_error on failure
  • See: Net_NNTP::connectAuthenticated()
  • See: Net_NNTP::connect()
  • Access: public

Parameters:

string   $user   —  The username
optional   $pass   —  string $pass The password
optional   $mode   —  string $mode The authentication mode (original, simple, generic).

[ Top ]

command   [line 732]

mixed command( string $cmd)

Issue a command to the NNTP server
  • Return: (int) response code on success or (object) pear_error on failure
  • Access: public

Parameters:

string   $cmd   —  The command to launch, ie: "ARTICLE 1004853"

[ Top ]

connect   [line 117]

mixed connect( [optional $host = NET_NNTP_PROTOCOL_DEFAULT_HOST], [optional $port = NET_NNTP_PROTOCOL_DEFAULT_PORT])

Connect to the NNTP-server.
  • Return: (bool) true on success or (object) pear_error on failure
  • See: Net_NNTP::connectAuthenticated()
  • See: Net_NNTP::authenticate()
  • See: Net_NNTP::quit()
  • Access: public

Overrides Net_NNTP_Protocol::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 ]

connectAuthenticated   [line 142]

mixed connectAuthenticated( [optional $user = null], [optional $pass = null], [optional $host = NET_NNTP_PROTOCOL_DEFAULT_HOST], [optional $port = NET_NNTP_PROTOCOL_DEFAULT_PORT], [optional $authmode = NET_NNTP_AUTHORIGINAL])

Connect to the NNTP-server, and authenticate using given username and password.
  • Return: (bool) true on success or (object) pear_error on failure
  • See: Net_NNTP::quit()
  • See: Net_NNTP::authenticate()
  • See: Net_NNTP::connect()
  • Since: 0.3
  • Access: public

Parameters:

optional   $user   —  string $user The username.
optional   $pass   —  string $pass The password.
optional   $host   —  string $host The IP-address of the NNTP-server to connect to.
optional   $port   —  int $port The port to connect to.
optional   $authmode   —  string $authmode The authentication mode.

[ Top ]

count   [line 659]

integer count( )

Number of articles in currently selected group
  • Return: number of article in group
  • See: Net_NNTP::last()
  • See: Net_NNTP::selectGroup()
  • See: Net_NNTP::first()
  • See: Net_NNTP::group()
  • Since: 0.3
  • Access: public

[ Top ]

first   [line 697]

integer first( )

Minimum article number in currently selected group
  • Return: number of first article
  • See: Net_NNTP::count()
  • See: Net_NNTP::selectGroup()
  • See: Net_NNTP::group()
  • See: Net_NNTP::last()
  • Since: 0.3
  • Access: public

[ Top ]

getArticle   [line 415]

mixed getArticle( mixed $article)

Get an article

The v0.2 version of the this function (which returned the article as a string) has been renamed to getArticleRaw().

  • Return: (object) message object on success or (object) pear_error on failure
  • See: Net_NNTP::getBody()
  • See: Net_NNTP::getHeader()
  • See: Net_NNTP::getArticleRaw()
  • Access: public

Parameters:

mixed   $article   —  Either the message-id or the message-number on the server of the article to fetch.

[ Top ]

getArticleRaw   [line 442]

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

Get a article (raw data)
  • Return: (array/string) The article on success or (object) pear_error on failure
  • See: Net_NNTP::getBodyRaw()
  • See: Net_NNTP::getHeaderRaw()
  • See: Net_NNTP::getArticle()
  • Access: public

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

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

Get the body of an article (raw data)
  • Return: (array/string) body on success or (object) pear_error on failure
  • See: Net_NNTP::getArticleRaw()
  • See: Net_NNTP::getHeaderRaw()
  • See: Net_NNTP::getBody()
  • Access: public

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

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

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

[ Top ]

getGroupArticles   [line 555]

void getGroupArticles( $newsgroup)

Experimental
  • Since: 0.3
  • Access: public

Parameters:

   $newsgroup   — 

[ Top ]

getGroups   [line 275]

mixed getGroups( )

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

[ Top ]

getHeader   [line 470]

mixed getHeader( mixed $article)

Get the header of an article
  • Return: (object) header object on success or (object) pear_error on failure
  • See: Net_NNTP::getBody()
  • See: Net_NNTP::getArticle()
  • See: Net_NNTP::getHeaderRaw()
  • Access: public

Parameters:

mixed   $article   —  Either the (string) message-id or the (int) message-number on the server of the article to fetch.

[ Top ]

getHeaderRaw   [line 498]

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

Get the header of an article (raw data)
  • Return: (array/string) header fields on success or (object) pear_error on failure
  • See: Net_NNTP::getBodyRaw()
  • See: Net_NNTP::getArticleRaw()
  • See: Net_NNTP::getHeader()
  • Access: public

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

void getNewGroups( $time)

Experimental
  • Since: 0.3
  • Access: public

Parameters:

   $time   — 

[ Top ]

getNewNews   [line 593]

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

Experimental
  • Since: 0.3
  • Access: public

Parameters:

   $time   — 
   $newsgroups   — 

[ Top ]

getOverview   [line 325]

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]

  • Return: (array) nested array of message and their headers on success or (object) pear_error on failure
  • See: Net_NNTP::getReferencesOverview()
  • See: Net_NNTP::getOverviewFormat()
  • Access: public

Parameters:

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

[ Top ]

getOverviewFormat   [line 345]

mixed getOverviewFormat( )

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

[ Top ]

getReferencesOverview   [line 363]

mixed getReferencesOverview( integer $first, integer $last)

Fetch a list of each message's reference header.
  • Return: (array) nested array of references on success or (object) pear_error on failure
  • See: Net_NNTP::getOverview()
  • Access: public

Parameters:

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

[ Top ]

group   [line 716]

string group( )

Currently selected group
  • Return: group name
  • See: Net_NNTP::count()
  • See: Net_NNTP::selectGroup()
  • See: Net_NNTP::last()
  • See: Net_NNTP::first()
  • Since: 0.3
  • Access: public

[ Top ]

isConnected   [line 230]

bool isConnected( )

Test whether a connection is currently open.
  • Return: true or false
  • See: Net_NNTP::quit()
  • See: Net_NNTP::connect()
  • Access: public

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

last   [line 678]

integer last( )

Maximum article number in currently selected group
  • Return: number of last article
  • See: Net_NNTP::count()
  • See: Net_NNTP::selectGroup()
  • See: Net_NNTP::group()
  • See: Net_NNTP::first()
  • Since: 0.3
  • Access: public

[ Top ]

post   [line 394]

mixed post( string $newsgroups, string $subject, string $body, string $from, [optional $aditional = ''])

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

void quit( )

Close connection to the newsserver
  • See: Net_NNTP::connect()
  • Access: public

[ Top ]

selectGroup   [line 251]

mixed selectGroup( string $newsgroup)

Selects a newsgroup
  • Return: (array) Info about the newsgroup on success or (object) pear_error on failure
  • See: Net_NNTP::count()
  • See: Net_NNTP::getGroups()
  • See: Net_NNTP::last()
  • See: Net_NNTP::first()
  • See: Net_NNTP::group()
  • Access: public

Parameters:

string   $newsgroup   —  Newsgroup name

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:52:40 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.