Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
  1: <?php
  2: 
  3: /*
  4:  * This file is part of SwiftMailer.
  5:  * (c) 2009 Fabien Potencier <fabien.potencier@gmail.com>
  6:  *
  7:  * For the full copyright and license information, please view the LICENSE
  8:  * file that was distributed with this source code.
  9:  */
 10: 
 11: /**
 12:  * Stores Messages in a queue.
 13:  * @package Swift
 14:  * @author  Fabien Potencier
 15:  */
 16: class Swift_Transport_SpoolTransport implements Swift_Transport
 17: {
 18:     /** The spool instance */
 19:     private $_spool;
 20: 
 21:     /** The event dispatcher from the plugin API */
 22:     private $_eventDispatcher;
 23: 
 24:     /**
 25:      * Constructor.
 26:      */
 27:     public function __construct(Swift_Events_EventDispatcher $eventDispatcher, Swift_Spool $spool = null)
 28:     {
 29:         $this->_eventDispatcher = $eventDispatcher;
 30:         $this->_spool = $spool;
 31:     }
 32: 
 33:     /**
 34:      * Sets the spool object.
 35:      * @param  Swift_Spool                    $spool
 36:      * @return Swift_Transport_SpoolTransport
 37:      */
 38:     public function setSpool(Swift_Spool $spool)
 39:     {
 40:         $this->_spool = $spool;
 41: 
 42:         return $this;
 43:     }
 44: 
 45:     /**
 46:      * Get the spool object.
 47:      * @return Swift_Spool
 48:      */
 49:     public function getSpool()
 50:     {
 51:         return $this->_spool;
 52:     }
 53: 
 54:     /**
 55:      * Tests if this Transport mechanism has started.
 56:      *
 57:      * @return boolean
 58:      */
 59:     public function isStarted()
 60:     {
 61:         return true;
 62:     }
 63: 
 64:     /**
 65:      * Starts this Transport mechanism.
 66:      */
 67:     public function start()
 68:     {
 69:     }
 70: 
 71:     /**
 72:      * Stops this Transport mechanism.
 73:      */
 74:     public function stop()
 75:     {
 76:     }
 77: 
 78:     /**
 79:      * Sends the given message.
 80:      *
 81:      * @param Swift_Mime_Message $message
 82:      * @param string[] &$failedRecipients to collect failures by-reference
 83:      *
 84:      * @return int The number of sent emails
 85:      */
 86:     public function send(Swift_Mime_Message $message, &$failedRecipients = null)
 87:     {
 88:         if ($evt = $this->_eventDispatcher->createSendEvent($this, $message)) {
 89:             $this->_eventDispatcher->dispatchEvent($evt, 'beforeSendPerformed');
 90:             if ($evt->bubbleCancelled()) {
 91:                 return 0;
 92:             }
 93:         }
 94: 
 95:         $success = $this->_spool->queueMessage($message);
 96: 
 97:         if ($evt) {
 98:             $evt->setResult($success ? Swift_Events_SendEvent::RESULT_SUCCESS : Swift_Events_SendEvent::RESULT_FAILED);
 99:             $this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed');
100:         }
101: 
102:         return 1;
103:     }
104: 
105:     /**
106:      * Register a plugin.
107:      *
108:      * @param Swift_Events_EventListener $plugin
109:      */
110:     public function registerPlugin(Swift_Events_EventListener $plugin)
111:     {
112:         $this->_eventDispatcher->bindEventListener($plugin);
113:     }
114: }
115: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen