Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

eznotificationtransport.php
Go to the documentation of this file.
1 <?php
16 class eZNotificationTransport
17 {
26 static function instance( $transport = false, $forceNewInstance = false )
27 {
28 $ini = eZINI::instance( 'notification.ini' );
29 if ( $transport == false )
30 {
31 $transport = $ini->variable( 'TransportSettings', 'DefaultTransport' );
32 }
33 $transportImpl =& $GLOBALS['eZNotificationTransportGlobalInstance_' . $transport ];
34 $class = $transportImpl !== null ? strtolower( get_class( $transportImpl ) ) : '';
35
36 $fetchInstance = false;
37 if ( !preg_match( '/.*?transport/', $class ) )
38 $fetchInstance = true;
39
40 if ( $forceNewInstance )
41 {
42 $fetchInstance = true;
43 }
44
45 if ( $fetchInstance )
46 {
47 $extraPluginPathArray = $ini->variable( 'TransportSettings', 'TransportPluginPath' );
48 $pluginPathArray = array_merge( array( 'kernel/classes/notification/' ),
49 $extraPluginPathArray );
50 foreach( $pluginPathArray as $pluginPath )
51 {
52 $transportFile = $pluginPath . $transport . 'notificationtransport.php';
53 if ( file_exists( $transportFile ) )
54 {
55 include_once( $transportFile );
56 $className = $transport . 'notificationtransport';
57 $impl = new $className( );
58 break;
59 }
60 }
61 }
62 if ( !isset( $impl ) )
63 {
64 $impl = new eZNotificationTransport();
65 eZDebug::writeError( 'Transport implementation not supported: ' . $transport, __METHOD__ );
66 }
67 return $impl;
68 }
69
70 function send( $address, $subject, $body, $transportData = null )
71 {
72 return true;
73 }
74 }
75
76 ?>
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZNotificationTransport
The class eZNotificationTransport does.
Definition: eznotificationtransport.php:17
eZNotificationTransport\instance
static instance( $transport=false, $forceNewInstance=false)
Definition: eznotificationtransport.php:26
eZNotificationTransport\send
send( $address, $subject, $body, $transportData=null)
Definition: eznotificationtransport.php:70
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.