/framework/vendor/swift/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php
PHP | 47 lines | 21 code | 5 blank | 21 comment | 2 complexity | 609c7fac7ae91cf6135d70c7cab23b19 MD5 | raw file
1<?php 2 3/* 4 * This file is part of SwiftMailer. 5 * (c) 2004-2009 Chris Corbyn 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//@require 'Swift/Plugins/Reporter.php'; 12//@require 'Swift/Mime/Message.php'; 13 14/** 15 * A HTML output reporter for the Reporter plugin. 16 * @package Swift 17 * @subpackage Plugins 18 * @author Chris Corbyn 19 */ 20class Swift_Plugins_Reporters_HtmlReporter implements Swift_Plugins_Reporter 21{ 22 23 /** 24 * Notifies this ReportNotifier that $address failed or succeeded. 25 * @param Swift_Mime_Message $message 26 * @param string $address 27 * @param int $result from {@link RESULT_PASS, RESULT_FAIL} 28 */ 29 public function notify(Swift_Mime_Message $message, $address, $result) 30 { 31 if (self::RESULT_PASS == $result) 32 { 33 echo "<div style=\"color: #fff; background: #006600; padding: 2px; margin: 2px;\">" . PHP_EOL; 34 echo "PASS " . $address . PHP_EOL; 35 echo "</div>" . PHP_EOL; 36 flush(); 37 } 38 else 39 { 40 echo "<div style=\"color: #fff; background: #880000; padding: 2px; margin: 2px;\">" . PHP_EOL; 41 echo "FAIL " . $address . PHP_EOL; 42 echo "</div>" . PHP_EOL; 43 flush(); 44 } 45 } 46 47}