00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 include_once( 'kernel/classes/notification/ezmailnotificationtransport.php' );
00040 class eZNotificationTransport
00041 {
00042
00043
00044
00045 function eZNotificationTransport()
00046 {
00047 }
00048
00049 function &instance( $transport = false, $forceNewInstance = false )
00050 {
00051 $ini =& eZINI::instance( 'notification.ini' );
00052 if ( $transport == false )
00053 {
00054 $transport = $ini->variable( 'TransportSettings', 'DefaultTransport' );
00055 }
00056 $transportImpl =& $GLOBALS['eZNotificationTransportGlobalInstance_' . $transport ];
00057 $class = get_class( $transportImpl );
00058
00059 $fetchInstance = false;
00060 if ( !preg_match( '/.*?transport/', $class ) )
00061 $fetchInstance = true;
00062
00063 if ( $forceNewInstance )
00064 {
00065 $fetchInstance = true;
00066 }
00067
00068 if ( $fetchInstance )
00069 {
00070 $extraPluginPathArray = $ini->variable( 'TransportSettings', 'TransportPluginPath' );
00071 $pluginPathArray = array_merge( array( 'kernel/classes/notification/' ),
00072 $extraPluginPathArray );
00073 foreach( $pluginPathArray as $pluginPath )
00074 {
00075 $transportFile = $pluginPath . $transport . 'notificationtransport.php';
00076 if ( file_exists( $transportFile ) )
00077 {
00078 include_once( $transportFile );
00079 $className = $transport . 'notificationtransport';
00080 $impl = new $className( );
00081 break;
00082 }
00083 }
00084 }
00085 if ( $impl === null )
00086 {
00087 $impl = new eZNotificationTransport();
00088 eZDebug::writeError( 'Transport implementation not supported: ' . $transport, 'eZNotificationTransport::instance' );
00089 }
00090 return $impl;
00091 }
00092
00093 function send( $address = array(), $subject, $body, $transportData = null )
00094 {
00095 return true;
00096 }
00097 }
00098
00099 ?>