TYPO3 API  SVNRelease
HtmlReporter.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * This file is part of SwiftMailer.
00005  * (c) 2004-2009 Chris Corbyn
00006  *
00007  * For the full copyright and license information, please view the LICENSE
00008  * file that was distributed with this source code.
00009  */
00010 
00011 //@require 'Swift/Plugins/Reporter.php';
00012 //@require 'Swift/Mime/Message.php';
00013 
00014 /**
00015  * A HTML output reporter for the Reporter plugin.
00016  * @package Swift
00017  * @subpackage Plugins
00018  * @author Chris Corbyn
00019  */
00020 class Swift_Plugins_Reporters_HtmlReporter implements Swift_Plugins_Reporter
00021 {
00022 
00023   /**
00024    * Notifies this ReportNotifier that $address failed or succeeded.
00025    * @param Swift_Mime_Message $message
00026    * @param string $address
00027    * @param int $result from {@link RESULT_PASS, RESULT_FAIL}
00028    */
00029   public function notify(Swift_Mime_Message $message, $address, $result)
00030   {
00031     if (self::RESULT_PASS == $result)
00032     {
00033       echo "<div style=\"color: #fff; background: #006600; padding: 2px; margin: 2px;\">" . PHP_EOL;
00034       echo "PASS " . $address . PHP_EOL;
00035       echo "</div>" . PHP_EOL;
00036       flush();
00037     }
00038     else
00039     {
00040       echo "<div style=\"color: #fff; background: #880000; padding: 2px; margin: 2px;\">" . PHP_EOL;
00041       echo "FAIL " . $address . PHP_EOL;
00042       echo "</div>" . PHP_EOL;
00043       flush();
00044     }
00045   }
00046 
00047 }