PHP Class Horde_Imsp_Client_Base, horde

Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Michael Rubinsky ([email protected])
Mostrar archivo Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$_logger Horde_Log_Logger Logger
$host string String containing name/IP address of IMSP host.
$lastRawError string String buffer containing the last raw NO or BAD response from the server.
$port string String containing port for IMSP server.

Protected Properties

Property Type Description
$_authObj Horde_Imsp_Auth The auth object
$_commandCount integer Current command count
$_commandPrefix string Current command prefix
$_lastCommandTag string Command tag last used.
$_tag string Currently in-use command tag

Public Methods

Method Description
__construct ( array $params ) Constructor function.
authenticate ( boolean $login = true ) : boolean Attempts to login to IMSP server.
capability ( ) : string Returns the raw capability response from the server.
getServerResponseChunks ( ) : array Retrieves CRLF terminated response from server and splits it into an array delimited by a .
logout ( ) Close connection and logout from IMSP server.
quoteSpacedString ( string $string ) : string Determines if a string needs to be quoted before sending to the server.
receive ( ) : mixed Receives a single CRLF terminated server response string
receiveStringLiteral ( integer $length ) : string Receives fixed number of bytes from IMSP socket. Used when server returns a string literal.
send ( string $commandText, boolean $includeTag = true, boolean $sendCRLF = true, boolean $continuation = false ) Attempts to send a command to the server.

Protected Methods

Method Description
_getNextCommandTag ( ) : string Increments the IMSP command tag token.

Method Details

__construct() public method

Required parameters:
 authObj    The object to handle the authentication
Optional parameters:
 server              The IMSP host
 port                The port the IMSP server listens on
 logger    The logger.
public __construct ( array $params )
$params array Hash containing server parameters.

_getNextCommandTag() protected method

Increments the IMSP command tag token.
protected _getNextCommandTag ( ) : string
return string Next command tag.

authenticate() abstract public method

Attempts to login to IMSP server.
abstract public authenticate ( boolean $login = true ) : boolean
$login boolean Should we remain logged in after auth?
return boolean

capability() abstract public method

Returns the raw capability response from the server.
abstract public capability ( ) : string
return string The raw capability response.

getServerResponseChunks() abstract public method

Retrieves CRLF terminated response from server and splits it into an array delimited by a .
abstract public getServerResponseChunks ( ) : array
return array The exploded string

logout() abstract public method

Close connection and logout from IMSP server.
abstract public logout ( )

quoteSpacedString() public static method

Determines if a string needs to be quoted before sending to the server.
public static quoteSpacedString ( string $string ) : string
$string string String to be tested.
return string Original string, quoted if needed.

receive() abstract public method

Receives a single CRLF terminated server response string
abstract public receive ( ) : mixed
return mixed 'NO', 'BAD', 'OK', raw response.

receiveStringLiteral() abstract public method

Receives fixed number of bytes from IMSP socket. Used when server returns a string literal.
abstract public receiveStringLiteral ( integer $length ) : string
$length integer Number of bytes to read from socket.
return string Text of string literal.

send() abstract public method

Attempts to send a command to the server.
abstract public send ( string $commandText, boolean $includeTag = true, boolean $sendCRLF = true, boolean $continuation = false )
$commandText string Text to send to the server.
$includeTag boolean Determines if command tag is prepended.
$sendCRLF boolean Determines if CRLF is appended.
$continuation boolean Expect a command continuation response.

Property Details

$_authObj protected_oe property

The auth object
protected Horde_Imsp_Auth $_authObj
return Horde_Imsp_Auth

$_commandCount protected_oe property

Current command count
protected int $_commandCount
return integer

$_commandPrefix protected_oe property

Current command prefix
protected string $_commandPrefix
return string

$_lastCommandTag protected_oe property

Command tag last used.
protected string $_lastCommandTag
return string

$_logger public_oe property

Logger
public Horde_Log_Logger $_logger
return Horde_Log_Logger

$_tag protected_oe property

Currently in-use command tag
protected string $_tag
return string

$host public_oe property

String containing name/IP address of IMSP host.
public string $host
return string

$lastRawError public_oe property

String buffer containing the last raw NO or BAD response from the server.
public string $lastRawError
return string

$port public_oe property

String containing port for IMSP server.
public string $port
return string