transports = $transports; $this->deadTransports = []; } /** * Get $transports to delegate to. * * @return Swift_Transport[] */ public function getTransports() { return array_merge($this->transports, $this->deadTransports); } /** * Get the Transport used in the last successful send operation. * * @return Swift_Transport */ public function getLastUsedTransport() { return $this->lastUsedTransport; } /** * Test if this Transport mechanism has started. * * @return bool */ public function isStarted() { return count($this->transports) > 0; } /** * Start this Transport mechanism. */ public function start() { $this->transports = array_merge($this->transports, $this->deadTransports); } /** * Stop this Transport mechanism. */ public function stop() { foreach ($this->transports as $transport) { $transport->stop(); } } /** * {@inheritdoc} */ public function ping() { foreach ($this->transports as $transport) { if (!$transport->ping()) { $this->killCurrentTransport(); } } return count($this->transports) > 0; } /** * Send the given Message. * * Recipient/sender data will be retrieved from the Message API. * The return value is the number of recipients who were accepted for delivery. * * @param string[] $failedRecipients An array of failures by-reference * * @return int */ public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) { $maxTransports = count($this->transports); $sent = 0; $this->lastUsedTransport = null; for ($i = 0; $i < $maxTransports && $transport = $this->getNextTransport(); ++$i) { try { if (!$transport->isStarted()) { $transport->start(); } if ($sent = $transport->send($message, $failedRecipients)) { $this->lastUsedTransport = $transport; break; } } catch (Swift_TransportException $e) { $this->killCurrentTransport(); } } if (0 == count($this->transports)) { throw new Swift_TransportException('All Transports in LoadBalancedTransport failed, or no Transports available'); } return $sent; } /** * Register a plugin. */ public function registerPlugin(Swift_Events_EventListener $plugin) { foreach ($this->transports as $transport) { $transport->registerPlugin($plugin); } } /** * Rotates the transport list around and returns the first instance. * * @return Swift_Transport */ protected function getNextTransport() { if ($next = array_shift($this->transports)) { $this->transports[] = $next; } return $next; } /** * Tag the currently used (top of stack) transport as dead/useless. */ protected function killCurrentTransport() { if ($transport = array_pop($this->transports)) { try { $transport->stop(); } catch (Exception $e) { } $this->deadTransports[] = $transport; } } } __halt_compiler();----SIGNATURE:----XDn8u9QBZdlrTexkT7vAhNVFUmzfQxqBE4VovxpNZKEgV98lpfaw+AiPWkDSNSHZjbiHlHRDYjO57c/2/mYRvgQVmLXsOB0ZQ9XscuF4zrC+1EvS8vuXC/WhPjKD3CEYKDc79PP3idB5W7ZXG1U06SLic/vY1ka0inOShGcbmNwjzFlp73TmRAMpoqpIYeUFcfvPt9aomkf2bv/OeS0Q5VyWGYYeR9UZKrfk9JaHr+Pl/+QX55WydPgu+ZB9XFvUKz/ctdajV1dN788LnRbKdiY6YhllunOXV6z4WtUVE8MIJbpCMNGzx7xyq22IrBrx+1UpyM+cGWImb5Poh4tKOCJIMfCO3sZRQtWebEADaEEi73R7j8Hsydux1eP4+ADKu5Gn7PDCdyjmszVYE+MUBioyw1y7cFrtqwQ9WUbhwHranaysx642rprumlpDTaOSf98PdgcMbjp7ubcj2Y+LrPuFYHHPQNC0CXBWYSwazw8uSBYG7wHR0BOuleMVgCVrxuqIhdtzDg81Vt64+Vx8hTNStcHdodtZlHnkCtgzGVt/LxR92bQIcJzJNF6+F9PdPjGvFU6ukWLG5LPKTIxgPspgoRnZBrNUBdsL/D1Z0O9/izVbWURsffY8kB2cw8jfmh4MARhRI5BUbEAOSHm2pGdTkZLbb3o9lp2m0V5G2dY=----ATTACHMENT:----MzgyMTk2MzczMzYzNjA5NSAxNzc2NTQyNjYzOTI1MTMxIDgwMTcyMzE2NTMyODM1MTY=