Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Zend_Mail_Protocol_Abstract Class Reference

Public Member Functions

 __construct ($host= '127.0.0.1', $port=null)
 Constructor.
 
 __destruct ()
 Class destructor to cleanup open resources.
 
 setMaximumLog ($maximumLog)
 Set the maximum log size.
 
 getMaximumLog ()
 Get the maximum log size.
 
 connect ()
 Create a connection to the remote host.
 
 getRequest ()
 Retrieve the last client request.
 
 getResponse ()
 Retrieve the last server response.
 
 getLog ()
 Retrieve the transaction log.
 
 resetLog ()
 Reset the transaction log.
 

Public Attributes

const EOL = "\r\n"
 Mail default EOL string.
 
const TIMEOUT_CONNECTION = 30
 Default timeout in seconds for initiating session.
 

Protected Member Functions

 _addLog ($value)
 Add the transaction log.
 
 _connect ($remote)
 Connect to the server using the supplied transport and target.
 
 _disconnect ()
 Disconnect from remote host and free resource.
 
 _send ($request)
 Send the given request followed by a LINEEND to the server.
 
 _receive ($timeout=null)
 
 _expect ($code, $timeout=null)
 Parse server response for successful codes.
 
 _setStreamTimeout ($timeout)
 Set stream timeout.
 

Protected Attributes

 $_maximumLog = 64
 
 $_host
 
 $_port
 
 $_validHost
 
 $_socket
 
 $_request
 
 $_response
 
 $_template = '%d%s'
 

Constructor & Destructor Documentation

__construct (   $host = '127.0.0.1',
  $port = null 
)

Constructor.

Parameters
string$hostOPTIONAL Hostname of remote connection (default: 127.0.0.1)
integer$portOPTIONAL Port number (default: null)
Exceptions
Zend_Mail_Protocol_Exception
Returns
void
See Also
Zend_Mail_Protocol_Exception
__destruct ( )

Class destructor to cleanup open resources.

Returns
void

Member Function Documentation

_addLog (   $value)
protected

Add the transaction log.

Parameters
stringnew transaction
Returns
void
_connect (   $remote)
protected

Connect to the server using the supplied transport and target.

An example $remote string may be 'tcp://mail.example.com:25' or 'ssh://hostname.com:2222'

Parameters
string$remoteRemote
Exceptions
Zend_Mail_Protocol_Exception
Returns
boolean
See Also
Zend_Mail_Protocol_Exception
Zend_Mail_Protocol_Exception
_disconnect ( )
protected

Disconnect from remote host and free resource.

Returns
void
_expect (   $code,
  $timeout = null 
)
protected

Parse server response for successful codes.

Read the response from the stream and check for expected return code. Throws a Zend_Mail_Protocol_Exception if an unexpected code is returned.

Parameters
string | array$codeOne or more codes that indicate a successful response
Exceptions
Zend_Mail_Protocol_Exception
Returns
string Last line of response string
See Also
Zend_Mail_Protocol_Exception
_receive (   $timeout = null)
protected
_send (   $request)
protected

Send the given request followed by a LINEEND to the server.

Parameters
string$request
Exceptions
Zend_Mail_Protocol_Exception
Returns
integer|boolean Number of bytes written to remote host
See Also
Zend_Mail_Protocol_Exception
Zend_Mail_Protocol_Exception
_setStreamTimeout (   $timeout)
protected

Set stream timeout.

Parameters
integer$timeout
Returns
boolean
connect ( )
abstract

Create a connection to the remote host.

Concrete adapters for this class will implement their own unique connect scripts, using the _connect() method to create the socket resource.

getLog ( )

Retrieve the transaction log.

Returns
string
getMaximumLog ( )

Get the maximum log size.

Returns
int the maximum log size
getRequest ( )

Retrieve the last client request.

Returns
string
getResponse ( )

Retrieve the last server response.

Returns
array
resetLog ( )

Reset the transaction log.

Returns
void
setMaximumLog (   $maximumLog)

Set the maximum log size.

Parameters
integer$maximumLogMaximum log size
Returns
void

Member Data Documentation

$_host
protected
$_maximumLog = 64
protected
$_port
protected
$_request
protected
$_response
protected
$_socket
protected
$_template = '%d%s'
protected
$_validHost
protected
const EOL = "\r\n"

Mail default EOL string.

const TIMEOUT_CONNECTION = 30

Default timeout in seconds for initiating session.