Class Net_IMSP

Description

The Net_IMSP class provides a common interface to an IMSP server .

Required parameters:

   'server'  Hostname of IMSP server.
   'port'    Port of IMSP server.

$Horde: framework/Net_IMSP/IMSP.php,v 1.13.10.27 2009/10/02 00:03:01 mrubinsk Exp $

Copyright 2003-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Net_IMSP/IMSP.php (line 27)


	
			
Variable Summary
 string $imsp_port
 string $imsp_server
 string $lastRawError
 boolean $logEnabled
 mixed $_logBuffer
 mixed $_logger
 mixed $_logLevel
 mixed $_logSet
 mixed $_stream
 mixed $_tag
Method Summary
 Net_IMSP Net_IMSP (array $params)
 string capability ()
 mixed factory (string $driver, mixed $params)
 void imspError ([string $err = ''], [string $file = __FILE__], [integer $line = __LINE__])
 mixed imspOpen ()
 mixed imspReceive ()
 mixed imspSend (string $commandText, [boolean $includeTag = true], [boolean $sendCRLF = true])
 mixed init ()
 void logout ()
 string quoteSpacedString (string $string)
 void receiveStringLiteral ( $length)
 mixed setLogger (array $params)
 mixed &singleton (string $driver, mixed $params)
 void writeToLog (string $message, [ $file = __FILE__], [ $line = __LINE__], [ $priority = PEAR_LOG_INFO])
Variables
string $imsp_port = '406' (line 41)

String containing port for IMSP server.

string $imsp_server = 'localhost' (line 34)

String containing name/IP address of IMSP host.

string $lastRawError = '' (line 56)

String buffer containing the last raw NO or BAD response from the server.

boolean $logEnabled = true (line 48)

Boolean to set if we should write to a log, if one is set up.

mixed $_commandCount = 1 (line 60)
mixed $_commandPrefix = 'A' (line 59)
mixed $_lastCommandTag = 'undefined' (line 63)
mixed $_logBuffer = array() (line 67)
mixed $_logger = null (line 64)
mixed $_logLevel = PEAR_LOG_INFO (line 66)
mixed $_logSet = null (line 65)
mixed $_stream = null (line 62)
mixed $_tag = '' (line 61)
Methods
Constructor Net_IMSP (line 74)

Constructor function.

Net_IMSP Net_IMSP (array $params)
  • array $params: Hash containing server parameters.
capability (line 127)

Returns the raw capability response from the server.

  • return: The raw capability response.
string capability ()
factory (line 435)

Attempts to create a Net_IMSP object based on $driver.

Must be called as $imsp = &Net_IMSP::factory($driver, $params);

  • return: The requested Net_IMSP object or PEAR_Error on failure.
mixed factory (string $driver, mixed $params)
  • string $driver: Type of Net_IMSP object to return.
  • mixed $params: Any parameters needed by the Net_IMSP object.
getServerResponseChunks (line 276)

Retrieves CRLF terminated response from server and splits it into an array delimited by a <space>.

  • return: result from explode().
array getServerResponseChunks ()
imspError (line 341)

Raises an IMSP error. Basically, only writes error out to the horde logfile and returns PEAR_Error

void imspError ([string $err = ''], [string $file = __FILE__], [integer $line = __LINE__])
  • string $err: Either PEAR_Error object or text to write to log.
  • string $file: File name where error occured.
  • integer $line: Line number where error occured.
imspOpen (line 158)

Attempts to open an IMSP socket with the server.

  • return: True on success PEAR_Error on failure.
mixed imspOpen ()
imspReceive (line 216)

Receives a single CRLF terminated server response string

  • return: 'NO', 'BAD', 'OK', raw response or PEAR_Error.
mixed imspReceive ()
imspSend (line 182)

Attempts to send a command to the server.

  • return: True on success PEAR_Error on failure.
mixed imspSend (string $commandText, [boolean $includeTag = true], [boolean $sendCRLF = true])
  • string $commandText: Text to send to the server.
  • boolean $includeTag: Determines if command tag is prepended.
  • boolean $sendCRLF: Determines if CRLF is appended.
init (line 92)

Initialization function to be called after object is returned. This allows errors to occur and not break the script.

  • return: True on success PEAR_Error on connection failure.
mixed init ()
logout (line 107)

Logs out of the server and closes the IMSP stream

void logout ()
quoteSpacedString (line 323)

Determines if a string needs to be quoted before sending to the server.

  • return: Original string quoted if needed.
string quoteSpacedString (string $string)
  • string $string: String to be tested.
receiveStringLiteral (line 292)
void receiveStringLiteral ( $length)
  • $length
setLogger (line 387)

Creates a new Log object based on $params

  • return: True on success or PEAR_Error on failure.
mixed setLogger (array $params)
  • array $params: Log object parameters.
singleton (line 461)

Attempts to return a Net_IMSP object based on $driver. Only creates a new object if one with the same parameters already doesn't exist.

Must be called as $imsp = &Net_IMSP::singleton($driver, $params);

  • return: Reference to the Net_IMSP object or PEAR_Error on failure.
mixed &singleton (string $driver, mixed $params)
  • string $driver: Type of Net_IMSP object to return.
  • mixed $params: Any parameters needed by the Net_IMSP object.
writeToLog (line 362)

Writes a message to the IMSP logfile.

void writeToLog (string $message, [ $file = __FILE__], [ $line = __LINE__], [ $priority = PEAR_LOG_INFO])
  • string $message: Text to write.
  • $file
  • $line
  • $priority

Documentation generated on Sun, 30 Jan 2011 05:18:32 +0000 by phpDocumentor 1.4.3