/
home
/
techb158
/
ileadtechnology.com
/
vendor
/
swiftmailer
/
swiftmailer
/
lib
/
classes
/
Swift
/
/home/techb158/ileadtechnology.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift
mkdir
upload
Name
Size
Mode
Actions
AddressEncoder/
-
0755
rm
ByteStream/
-
0755
rm
CharacterReader/
-
0755
rm
CharacterReaderFactory/
-
0755
rm
CharacterStream/
-
0755
rm
Encoder/
-
0755
rm
Events/
-
0755
rm
KeyCache/
-
0755
rm
Mailer/
-
0755
rm
Mime/
-
0755
rm
Plugins/
-
0755
rm
Signers/
-
0755
rm
StreamFilters/
-
0755
rm
Transport/
-
0755
rm
AddressEncoder.php
595
0644
edit
dl
rm
AddressEncoderException.php
721
0644
edit
dl
rm
Attachment.php
1449
0644
edit
dl
rm
CharacterReader.php
1740
0644
edit
dl
rm
CharacterReaderFactory.php
542
0644
edit
dl
rm
CharacterStream.php
2158
0644
edit
dl
rm
ConfigurableSpool.php
1362
0644
edit
dl
rm
DependencyContainer.php
9928
0644
edit
dl
rm
DependencyException.php
588
0644
edit
dl
rm
EmbeddedFile.php
1407
0644
edit
dl
rm
Encoder.php
734
0644
edit
dl
rm
FailoverTransport.php
865
0644
edit
dl
rm
FileSpool.php
5620
0644
edit
dl
rm
FileStream.php
488
0644
edit
dl
rm
Filterable.php
626
0644
edit
dl
rm
IdGenerator.php
433
0644
edit
dl
rm
Image.php
1052
0644
edit
dl
rm
InputByteStream.php
1963
0644
edit
dl
rm
IoException.php
605
0644
edit
dl
rm
KeyCache.php
2802
0644
edit
dl
rm
LoadBalancedTransport.php
878
0644
edit
dl
rm
Mailer.php
2566
0644
edit
dl
rm
MemorySpool.php
2760
0644
edit
dl
rm
Message.php
7167
0644
edit
dl
rm
MimePart.php
1168
0644
edit
dl
rm
NullTransport.php
673
0644
edit
dl
rm
OutputByteStream.php
1128
0644
edit
dl
rm
Preferences.php
2225
0644
edit
dl
rm
ReplacementFilterFactory.php
549
0644
edit
dl
rm
RfcComplianceException.php
554
0644
edit
dl
rm
SendmailTransport.php
886
0644
edit
dl
rm
Signer.php
365
0644
edit
dl
rm
SmtpTransport.php
1723
0644
edit
dl
rm
Spool.php
1240
0644
edit
dl
rm
SpoolTransport.php
780
0644
edit
dl
rm
StreamFilter.php
720
0644
edit
dl
rm
SwiftException.php
601
0644
edit
dl
rm
Transport.php
2014
0644
edit
dl
rm
TransportException.php
670
0644
edit
dl
rm
Edit:
/home/techb158/ileadtechnology.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php
(5620B)
<?php /* * This file is part of SwiftMailer. * (c) 2009 Fabien Potencier <fabien.potencier@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Stores Messages on the filesystem. * * @author Fabien Potencier * @author Xavier De Cock <xdecock@gmail.com> */ class Swift_FileSpool extends Swift_ConfigurableSpool { /** The spool directory */ private $path; /** * File WriteRetry Limit. * * @var int */ private $retryLimit = 10; /** * Create a new FileSpool. * * @param string $path * * @throws Swift_IoException */ public function __construct($path) { $this->path = $path; if (!file_exists($this->path)) { if (!mkdir($this->path, 0777, true)) { throw new Swift_IoException(sprintf('Unable to create path "%s".', $this->path)); } } } /** * Tests if this Spool mechanism has started. * * @return bool */ public function isStarted() { return true; } /** * Starts this Spool mechanism. */ public function start() { } /** * Stops this Spool mechanism. */ public function stop() { } /** * Allow to manage the enqueuing retry limit. * * Default, is ten and allows over 64^20 different fileNames * * @param int $limit */ public function setRetryLimit($limit) { $this->retryLimit = $limit; } /** * Queues a message. * * @param Swift_Mime_SimpleMessage $message The message to store * * @throws Swift_IoException * * @return bool */ public function queueMessage(Swift_Mime_SimpleMessage $message) { $ser = serialize($message); $fileName = $this->path.'/'.$this->getRandomString(10); for ($i = 0; $i < $this->retryLimit; ++$i) { /* We try an exclusive creation of the file. This is an atomic operation, it avoid locking mechanism */ $fp = @fopen($fileName.'.message', 'xb'); if (false !== $fp) { if (false === fwrite($fp, $ser)) { return false; } return fclose($fp); } else { /* The file already exists, we try a longer fileName */ $fileName .= $this->getRandomString(1); } } throw new Swift_IoException(sprintf('Unable to create a file for enqueuing Message in "%s".', $this->path)); } /** * Execute a recovery if for any reason a process is sending for too long. * * @param int $timeout in second Defaults is for very slow smtp responses */ public function recover($timeout = 900) { foreach (new DirectoryIterator($this->path) as $file) { $file = $file->getRealPath(); if ('.message.sending' == substr($file, -16)) { $lockedtime = filectime($file); if ((time() - $lockedtime) > $timeout) { rename($file, substr($file, 0, -8)); } } } } /** * Sends messages using the given transport instance. * * @param Swift_Transport $transport A transport instance * @param string[] $failedRecipients An array of failures by-reference * * @return int The number of sent e-mail's */ public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) { $directoryIterator = new DirectoryIterator($this->path); /* Start the transport only if there are queued files to send */ if (!$transport->isStarted()) { foreach ($directoryIterator as $file) { if ('.message' == substr($file->getRealPath(), -8)) { $transport->start(); break; } } } $failedRecipients = (array) $failedRecipients; $count = 0; $time = time(); foreach ($directoryIterator as $file) { $file = $file->getRealPath(); if ('.message' != substr($file, -8)) { continue; } /* We try a rename, it's an atomic operation, and avoid locking the file */ if (rename($file, $file.'.sending')) { $message = unserialize(file_get_contents($file.'.sending')); $count += $transport->send($message, $failedRecipients); unlink($file.'.sending'); } else { /* This message has just been catched by another process */ continue; } if ($this->getMessageLimit() && $count >= $this->getMessageLimit()) { break; } if ($this->getTimeLimit() && (time() - $time) >= $this->getTimeLimit()) { break; } } return $count; } /** * Returns a random string needed to generate a fileName for the queue. * * @param int $count * * @return string */ protected function getRandomString($count) { // This string MUST stay FS safe, avoid special chars $base = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-'; $ret = ''; $strlen = \strlen($base); for ($i = 0; $i < $count; ++$i) { $ret .= $base[random_int(0, $strlen - 1)]; } return $ret; } }
Save
cmd:
run