Added:
/framework/trunk/piwi/lib/piwi/SwiftWrapper.class.php
Modified:
/framework/trunk/piwi/index.php
=======================================
--- /dev/null
+++ /framework/trunk/piwi/lib/piwi/SwiftWrapper.class.php Fri Nov 19
05:32:23 2010
@@ -0,0 +1,13 @@
+<?php
+
+class SwiftWrapper {
+ private static $dependency = false;
+ public static function autoload($class) {
+ if(!self::$dependency) {
+ require_once 'lib/swiftmailer/swift_init.php';
+ self::$dependency = true;
+ }
+ Swift::autoload($class);
+ }
+}
+?>
=======================================
--- /framework/trunk/piwi/index.php Fri Nov 19 05:21:09 2010
+++ /framework/trunk/piwi/index.php Fri Nov 19 05:32:23 2010
@@ -29,9 +29,9 @@
*
-------------------------------------------------------------------------
*/
-error_reporting(0); // hide all errors
+//error_reporting(0); // hide all errors
//error_reporting(E_ERROR); // show only errors
-//error_reporting(E_ALL); // show all errors
+error_reporting(E_ALL); // show all errors
/**
*
-------------------------------------------------------------------------
@@ -65,7 +65,11 @@
spl_autoload_register( array( 'ezcBase', 'autoload' ) );
spl_autoload_register( array( 'ClassLoader', 'autoload' ) );
-spl_autoload_register( array('Swift', 'autoload') );
+spl_autoload_register( array('SwiftWrapper', 'autoload') );
+
+//Create the message
+$message = Swift_Message::newInstance();
+$message->setSubject('My subject');
/* Enable logging */
$logger = Logger :: getLogger('index.php');