swiftmailer

This commit is contained in:
Frédéric FRANCE
2018-01-21 15:55:56 +01:00
parent 3a8ceb130f
commit a34b99f3ec
191 changed files with 5164 additions and 4074 deletions

View File

@@ -20,28 +20,28 @@ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_
*
* @var int
*/
private $_threshold;
private $threshold;
/**
* The number of seconds to sleep for during a restart.
*
* @var int
*/
private $_sleep;
private $sleep;
/**
* The internal counter.
*
* @var int
*/
private $_counter = 0;
private $counter = 0;
/**
* The Sleeper instance for sleeping.
*
* @var Swift_Plugins_Sleeper
*/
private $_sleeper;
private $sleeper;
/**
* Create a new AntiFloodPlugin with $threshold and $sleep time.
@@ -54,7 +54,7 @@ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_
{
$this->setThreshold($threshold);
$this->setSleepTime($sleep);
$this->_sleeper = $sleeper;
$this->sleeper = $sleeper;
}
/**
@@ -64,7 +64,7 @@ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_
*/
public function setThreshold($threshold)
{
$this->_threshold = $threshold;
$this->threshold = $threshold;
}
/**
@@ -74,7 +74,7 @@ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_
*/
public function getThreshold()
{
return $this->_threshold;
return $this->threshold;
}
/**
@@ -84,7 +84,7 @@ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_
*/
public function setSleepTime($sleep)
{
$this->_sleep = $sleep;
$this->sleep = $sleep;
}
/**
@@ -94,7 +94,7 @@ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_
*/
public function getSleepTime()
{
return $this->_sleep;
return $this->sleep;
}
/**
@@ -113,15 +113,15 @@ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_
*/
public function sendPerformed(Swift_Events_SendEvent $evt)
{
++$this->_counter;
if ($this->_counter >= $this->_threshold) {
++$this->counter;
if ($this->counter >= $this->threshold) {
$transport = $evt->getTransport();
$transport->stop();
if ($this->_sleep) {
$this->sleep($this->_sleep);
if ($this->sleep) {
$this->sleep($this->sleep);
}
$transport->start();
$this->_counter = 0;
$this->counter = 0;
}
}
@@ -132,8 +132,8 @@ class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener, Swift_
*/
public function sleep($seconds)
{
if (isset($this->_sleeper)) {
$this->_sleeper->sleep($seconds);
if (isset($this->sleeper)) {
$this->sleeper->sleep($seconds);
} else {
sleep($seconds);
}