TYPO3  7.6
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Swift_Plugins_PopBeforeSmtpPlugin Class Reference
Inheritance diagram for Swift_Plugins_PopBeforeSmtpPlugin:
Swift_Events_TransportChangeListener Swift_Plugins_Pop_Pop3Connection Swift_Events_EventListener

Public Member Functions

 __construct ($host, $port=110, $crypto=null)
 
 setConnection (Swift_Plugins_Pop_Pop3Connection $connection)
 
 bindSmtp (Swift_Transport $smtp)
 
 setTimeout ($timeout)
 
 setUsername ($username)
 
 setPassword ($password)
 
 connect ()
 
 disconnect ()
 
 beforeTransportStarted (Swift_Events_TransportChangeEvent $evt)
 
 transportStarted (Swift_Events_TransportChangeEvent $evt)
 
 beforeTransportStopped (Swift_Events_TransportChangeEvent $evt)
 
 transportStopped (Swift_Events_TransportChangeEvent $evt)
 

Static Public Member Functions

static newInstance ($host, $port=110, $crypto=null)
 

Private Member Functions

 _command ($command)
 
 _assertOk ($response)
 
 _getHostString ()
 

Private Attributes

 $_connection
 
 $_host
 
 $_port
 
 $_crypto
 
 $_username
 
 $_password
 
 $_socket
 
 $_timeout = 10
 
 $_transport
 

Detailed Description

Makes sure a connection to a POP3 host has been established prior to connecting to SMTP.

Author
Chris Corbyn

Definition at line 16 of file PopBeforeSmtpPlugin.php.

Constructor & Destructor Documentation

__construct (   $host,
  $port = 110,
  $crypto = null 
)

Create a new PopBeforeSmtpPlugin for $host and $port.

Parameters
string$host
int$port
string$cryptoas "tls" or "ssl"

Definition at line 52 of file PopBeforeSmtpPlugin.php.

Member Function Documentation

_assertOk (   $response)
private

Definition at line 249 of file PopBeforeSmtpPlugin.php.

References $response.

Referenced by _command(), and connect().

_command (   $command)
private

Definition at line 230 of file PopBeforeSmtpPlugin.php.

References $response, and _assertOk().

Referenced by connect(), and disconnect().

_getHostString ( )
private

Definition at line 258 of file PopBeforeSmtpPlugin.php.

References $_host.

Referenced by connect().

beforeTransportStarted ( Swift_Events_TransportChangeEvent  $evt)

Invoked just before a Transport is started.

Parameters
Swift_Events_TransportChangeEvent$evt

Implements Swift_Events_TransportChangeListener.

Definition at line 197 of file PopBeforeSmtpPlugin.php.

References connect(), disconnect(), and Swift_Events_TransportChangeEvent\getTransport().

beforeTransportStopped ( Swift_Events_TransportChangeEvent  $evt)

Not used.

Implements Swift_Events_TransportChangeListener.

Definition at line 219 of file PopBeforeSmtpPlugin.php.

bindSmtp ( Swift_Transport  $smtp)

Bind this plugin to a specific SMTP transport instance.

Parameters
Swift_Transport

Definition at line 92 of file PopBeforeSmtpPlugin.php.

connect ( )

Connect to the POP3 host and authenticate.

Exceptions
Swift_Plugins_Pop_Pop3Exceptionif connection fails

Implements Swift_Plugins_Pop_Pop3Connection.

Definition at line 144 of file PopBeforeSmtpPlugin.php.

References _assertOk(), _command(), and _getHostString().

Referenced by beforeTransportStarted().

disconnect ( )

Disconnect from the POP3 host.

Implements Swift_Plugins_Pop_Pop3Connection.

Definition at line 177 of file PopBeforeSmtpPlugin.php.

References _command().

Referenced by beforeTransportStarted().

static newInstance (   $host,
  $port = 110,
  $crypto = null 
)
static

Create a new PopBeforeSmtpPlugin for $host and $port.

Parameters
string$host
int$port
string$cryptoas "tls" or "ssl"
Returns
Swift_Plugins_PopBeforeSmtpPlugin

Definition at line 68 of file PopBeforeSmtpPlugin.php.

setConnection ( Swift_Plugins_Pop_Pop3Connection  $connection)

Set a Pop3Connection to delegate to instead of connecting directly.

Parameters
Swift_Plugins_Pop_Pop3Connection$connection
Returns
Swift_Plugins_PopBeforeSmtpPlugin

Definition at line 80 of file PopBeforeSmtpPlugin.php.

setPassword (   $password)

Set the password to use when connecting (if needed).

Parameters
string$password
Returns
Swift_Plugins_PopBeforeSmtpPlugin

Definition at line 132 of file PopBeforeSmtpPlugin.php.

setTimeout (   $timeout)

Set the connection timeout in seconds (default 10).

Parameters
int$timeout
Returns
Swift_Plugins_PopBeforeSmtpPlugin

Definition at line 104 of file PopBeforeSmtpPlugin.php.

setUsername (   $username)

Set the username to use when connecting (if needed).

Parameters
string$username
Returns
Swift_Plugins_PopBeforeSmtpPlugin

Definition at line 118 of file PopBeforeSmtpPlugin.php.

transportStarted ( Swift_Events_TransportChangeEvent  $evt)

Not used.

Implements Swift_Events_TransportChangeListener.

Definition at line 212 of file PopBeforeSmtpPlugin.php.

transportStopped ( Swift_Events_TransportChangeEvent  $evt)

Not used.

Implements Swift_Events_TransportChangeListener.

Definition at line 226 of file PopBeforeSmtpPlugin.php.

Member Data Documentation

$_connection
private

A delegate connection to use (mostly a test hook)

Definition at line 19 of file PopBeforeSmtpPlugin.php.

$_crypto
private

Encryption type to use (if any)

Definition at line 28 of file PopBeforeSmtpPlugin.php.

$_host
private

Hostname of the POP3 server

Definition at line 22 of file PopBeforeSmtpPlugin.php.

Referenced by _getHostString().

$_password
private

Password to use (if any)

Definition at line 34 of file PopBeforeSmtpPlugin.php.

$_port
private

Port number to connect on

Definition at line 25 of file PopBeforeSmtpPlugin.php.

$_socket
private

Established connection via TCP socket

Definition at line 37 of file PopBeforeSmtpPlugin.php.

$_timeout = 10
private

Connect timeout in seconds

Definition at line 40 of file PopBeforeSmtpPlugin.php.

$_transport
private

SMTP Transport to bind to

Definition at line 43 of file PopBeforeSmtpPlugin.php.

$_username
private

Username to use (if any)

Definition at line 31 of file PopBeforeSmtpPlugin.php.