home
/
zktecojo
/
public_html
/
vendor
/
swiftmailer
/
swiftmailer
/
lib
/
classes
/
Swift
➕ New
📤 Upload
✎ Editing:
MemorySpool.php
← Back
<?php /* * This file is part of SwiftMailer. * (c) 2011 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 in memory. * * @author Fabien Potencier */ class Swift_MemorySpool implements Swift_Spool { protected $messages = array(); /** * Tests if this Transport mechanism has started. * * @return bool */ public function isStarted() { return true; } /** * Starts this Transport mechanism. */ public function start() { } /** * Stops this Transport mechanism. */ public function stop() { } /** * Stores a message in the queue. * * @param Swift_Mime_Message $message The message to store * * @return bool Whether the operation has succeeded */ public function queueMessage(Swift_Mime_Message $message) { //clone the message to make sure it is not changed while in the queue $this->messages[] = clone $message; return true; } /** * 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 emails */ public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) { if (!$this->messages) { return 0; } if (!$transport->isStarted()) { $transport->start(); } $count = 0; while ($message = array_pop($this->messages)) { $count += $transport->send($message, $failedRecipients); } return $count; } }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel