PHP Class Horde_Imsp_Client_Socket, 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])
Inheritance: extends Horde_Imsp_Client_Base
Mostrar archivo Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_authObj Horde_Imsp_Auth_Base
$_stream resource Stream handle

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 ( ) Logs out of the server and closes the IMSP stream
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
_imspOpen ( ) Attempts to open an IMSP socket with the server.

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.

_imspOpen() protected method

Attempts to open an IMSP socket with the server.
protected _imspOpen ( )

authenticate() public method

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

capability() public method

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

getServerResponseChunks() public method

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

logout() public method

Logs out of the server and closes the IMSP stream
public logout ( )

receive() public method

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

receiveStringLiteral() public method

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

send() public method

Attempts to send a command to the server.
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

protected Horde_Imsp_Auth_Base $_authObj
return Horde_Imsp_Auth_Base

$_stream protected_oe property

Stream handle
protected resource $_stream
return resource