PHP Class Swift_FileSpool

Author: Fabien Potencier
Inheritance: implements Swift_Spool
Show file Open project: swiftmailer/swiftmailer Class Usage Examples

Public Methods

Method Description
__construct ( string $path ) Create a new FileSpool.
flushQueue ( Swift_Transport $transport, string[] &$failedRecipients = null ) : integer Sends messages using the given transport instance.
isStarted ( ) : boolean Tests if this Spool mechanism has started.
queueMessage ( Swift_Mime_Message $message ) : boolean Queues a message.
recover ( integer $timeout = 900 ) Execute a recovery if for any reason a process is sending for too long.
setRetryLimit ( integer $limit ) Allow to manage the enqueuing retry limit.
start ( ) Starts this Spool mechanism.
stop ( ) Stops this Spool mechanism.

Protected Methods

Method Description
getRandomString ( integer $count ) : string Returns a random string needed to generate a fileName for the queue.

Method Details

__construct() public method

Create a new FileSpool.
public __construct ( string $path )
$path string

flushQueue() public method

Sends messages using the given transport instance.
public flushQueue ( Swift_Transport $transport, string[] &$failedRecipients = null ) : integer
$transport Swift_Transport A transport instance
$failedRecipients string[] An array of failures by-reference
return integer The number of sent e-mail's

getRandomString() protected method

Returns a random string needed to generate a fileName for the queue.
protected getRandomString ( integer $count ) : string
$count integer
return string

isStarted() public method

Tests if this Spool mechanism has started.
public isStarted ( ) : boolean
return boolean

queueMessage() public method

Queues a message.
public queueMessage ( Swift_Mime_Message $message ) : boolean
$message Swift_Mime_Message The message to store
return boolean

recover() public method

Execute a recovery if for any reason a process is sending for too long.
public recover ( integer $timeout = 900 )
$timeout integer in second Defaults is for very slow smtp responses

setRetryLimit() public method

Default, is ten and allows over 64^20 different fileNames
public setRetryLimit ( integer $limit )
$limit integer

start() public method

Starts this Spool mechanism.
public start ( )

stop() public method

Stops this Spool mechanism.
public stop ( )