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

Class: Net_NNTP

Source Location: /Net_NNTP-0.2.5/NNTP.php

Class Overview

PEAR
   |
   --Net_NNTP

The NNTP:: class fetches UseNet news articles acording to the standard based on RFC 1036.


Author(s):

Version:

  • 0.2.2

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 50]
The NNTP:: class fetches UseNet news articles acording to the standard based on RFC 1036.


[ Top ]


Class Variables

$authmode =  null

[line 57]


Type:   mixed


[ Top ]

$fp =  null

[line 60]

File pointer of the nntp-connection

Type:   mixed


[ Top ]

$max =  ''

[line 53]


Type:   mixed


[ Top ]

$min =  ''

[line 54]


Type:   mixed


[ Top ]

$pass =  null

[line 56]


Type:   mixed


[ Top ]

$user =  null

[line 55]


Type:   mixed


[ Top ]



Method Detail

authenticate   [line 169]

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

Auth process (not yet standarized but used any way) http://www.mibsoftware.com/userkt/nntpext/index.html
  • Return: (bool) true on success or Pear Error obj on fail
  • Access: public

Parameters:

string   $user   —  The user name
string   $pass   —  (optional) The password if needed
string   $mode   —  Authinfo form: original, simple, generic

[ Top ]

command   [line 680]

mixed command( string $cmd, [bool $testauth = true])

Issue a command to the NNTP server
  • Return: True on success or Pear Error object on failure
  • Access: public

Parameters:

string   $cmd   —  The command to launch, ie: "ARTICLE 1004853"
bool   $testauth   —  Test or not the auth

[ Top ]

connect   [line 74]

mixed connect( string $nntpserver, [int $port = 119], [string $user = null], [string $pass = null], [string $authmode = NET_NNTP_AUTHORIGINAL])

Connect to the newsserver
  • Return: True on success or Pear Error object on failure
  • See: Net_Nntp::authenticate()
  • Access: public

Parameters:

string   $nntpserver   —  The adress of the NNTP-server to connect to.
int   $port   —  (optional) the port-number to connect to, defaults to 119.
string   $user   —  (optional) The user name to authenticate with
string   $pass   —  (optional) The password
string   $authmode   —  (optional) The authentication mode

[ Top ]

date   [line 567]

array date( )

Get the date from the newsserver

format of returned date: $date['y'] - year $date['m'] - month $date['d'] - day

  • Return: date
  • Access: public

[ Top ]

getArticle   [line 210]

string getArticle( mixed $article)

Get an article from the currently open connection.

To get articles from another newsgroup a new prepare_connection() - call has to be made with apropriate parameters

  • Return: the article
  • Access: public

Parameters:

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

[ Top ]

getBody   [line 375]

void getBody( string $article)

Get the body of an article from the currently open connection.

To get the body of an article from another newsgroup, a new prepare_connection()-call has to be made with apropriate parameters

  • Access: public

Parameters:

string   $article   —  Either a message-id or a message-number of the article to fetch the headers from.

[ Top ]

getGroups   [line 468]

array getGroups( [int $fetch = true])

Fetches a list of all avaible newsgroups
  • Return: nested array with informations about existing newsgroups
  • Author: Morgan Christiansson <mog@linux.nu>

Parameters:

int   $fetch   —  PEAR_NNTP_ALL PEAR_NNTP_NAMES PEAR_NNTP_LIST

[ Top ]

getHeaders   [line 291]

array getHeaders( string $article)

Get the headers of an article from the currently open connection To get the headers of an article from another newsgroup, a new prepare_connection()-call has to be made with apropriate parameters
  • Return: Header
  • Access: public

Parameters:

string   $article   —  Either a message-id or a message-number of the article to fetch the headers from.

[ Top ]

getOverview   [line 535]

array getOverview( 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: nested array of message and there headers
  • Access: public

Parameters:

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

[ Top ]

getOverviewFmt   [line 502]

array getOverviewFmt( )

Returns a list of avaible headers which are send from newsserver to client for every news message
  • Return: header names
  • Access: public

[ Top ]

get_article   [line 233]

void get_article( $article)

  • Deprecated:

Parameters:

   $article   — 

[ Top ]

get_body   [line 399]

void get_body( $article)

  • Deprecated:

Parameters:

   $article   — 

[ Top ]

get_data   [line 427]

void get_data( )

  • Deprecated:

[ Top ]

get_groups   [line 490]

void get_groups( [ $fetch = true])

  • Deprecated:

Parameters:

   $fetch   — 

[ Top ]

get_headers   [line 315]

void get_headers( $article)

  • Deprecated:

Parameters:

   $article   — 

[ Top ]

get_overview   [line 553]

void get_overview( $first, $last)

  • Deprecated:

Parameters:

   $first   — 
   $last   — 

[ Top ]

get_overview_fmt   [line 518]

void get_overview_fmt( )

  • Deprecated:

[ Top ]

isConnected   [line 614]

bool isConnected( )

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

[ Top ]

is_connected   [line 625]

void is_connected( )

  • Deprecated:

[ Top ]

max   [line 586]

integer max( )

Maximum article number in current group
  • Return: maximum
  • Access: public

[ Top ]

min   [line 600]

integer min( )

Minimum article number in current group
  • Return: minimum
  • Access: public

[ Top ]

post   [line 254]

string post( string $subject, string $newsgroup, string $from, string $body, [ $aditional = ""], string $aditionak)

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. Or "Organization: <org>" which contain the name of the organization the post originates from.

  • Return: server response
  • Access: public

Parameters:

string   $subject   —  The subject of the post.
string   $newsgroup   —  The newsgroup to post to.
string   $from   —  Name + email-adress of sender.
string   $body   —  The body of the post itself.
string   $aditionak   —  (optional) Aditional headers to send.
   $aditional   — 

[ Top ]

prepareConnection   [line 120]

mixed prepareConnection( string $nntpserver, [int $port = 119], string $newsgroup, [string $user = null], [string $pass = null], [string $authmode = NET_NNTP_AUTHORIGINAL])

Connect to the newsserver, and issue a GROUP command Once connection is prepared, we can only fetch articles from one group at a time, to fetch from another group, a new connection has to be made.

This is to avoid the GROUP command for every article, as it is very ressource intensive on the newsserver especially when used for groups with many articles.

  • Return: True on success or Pear Error object on failure
  • See: Net_Nntp::authenticate()
  • Deprecated: Use connect() instead
  • Access: public

Parameters:

string   $nntpserver   —  The adress of the NNTP-server to connect to.
int   $port   —  (optional) the port-number to connect to, defaults to 119.
string   $newsgroup   —  The name of the newsgroup to use.
string   $user   —  (optional) The user name to authenticate with
string   $pass   —  (optional) The password
string   $authmode   —  (optional) The authentication mode

[ Top ]

prepare_connection   [line 149]

void prepare_connection( $nntpserver, [ $port = 119], $newsgroup, [ $user = null], [ $pass = null], [ $authmode = NET_NNTP_AUTHORIGINAL])

  • Deprecated:

Parameters:

   $nntpserver   — 
   $port   — 
   $newsgroup   — 
   $user   — 
   $pass   — 
   $authmode   — 

[ Top ]

quit   [line 634]

void quit( )

Close connection to the newsserver
  • Access: public

[ Top ]

responseCode   [line 648]

integer responseCode( string $response)

returns the response code of a newsserver command
  • Return: response code
  • Access: public

Parameters:

string   $response   —  newsserver answer

[ Top ]

selectGroup   [line 437]

mixed selectGroup( string $newsgroup)

Selects a news group (issue a GROUP command to the server)
  • Return: Array on success or Pear Error object on failure

Parameters:

string   $newsgroup   —  The newsgroup name

[ Top ]

select_group   [line 456]

void select_group( $newsgroup)

  • Deprecated:

Parameters:

   $newsgroup   — 

[ Top ]

setDebug   [line 660]

void setDebug( [boolean $on = true])

sets debug on or off
  • Access: public

Parameters:

boolean   $on   —  true=on, false=off

[ Top ]

set_debug   [line 668]

void set_debug( [ $on = true])

  • Deprecated:

Parameters:

   $on   — 

[ Top ]

splitHeaders   [line 333]

array splitHeaders( $article $article)

Returns the headers of a given article in the form of

an associative array. Ex: array( 'From' => 'foo@bar.com (Foo Smith)', 'Subject' => 'Re: Using NNTP class', .... );

  • Return: Assoc array with headers names as key or Pear obj error
  • Access: public

Parameters:

$article   $article   —  string Article number or id

[ Top ]

split_headers   [line 363]

void split_headers( $article)

  • Deprecated:

Parameters:

   $article   — 

[ Top ]


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