[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 * This file is part of the DebugBar package. 4 * 5 * (c) 2013 Maxime Bouroumeau-Fuseau 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 namespace DebugBar\Bridge\SwiftMailer; 12 13 use DebugBar\DataCollector\MessagesCollector; 14 use Swift_Mailer; 15 use Swift_Plugins_Logger; 16 use Swift_Plugins_LoggerPlugin; 17 18 /** 19 * Collects log messages 20 * 21 * http://swiftmailer.org/ 22 */ 23 class SwiftLogCollector extends MessagesCollector implements Swift_Plugins_Logger 24 { 25 public function __construct(Swift_Mailer $mailer) 26 { 27 $mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this)); 28 } 29 30 public function add($entry) 31 { 32 $this->addMessage($entry); 33 } 34 35 public function dump() 36 { 37 $dump = ''; 38 foreach ($this->messages as $message) { 39 if (!$message['is_string']) { 40 continue; 41 } 42 43 $dump .= $message['message'] . PHP_EOL; 44 } 45 46 return $dump; 47 } 48 49 public function getName() 50 { 51 return 'swiftmailer_logs'; 52 } 53 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |