[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/classes/notification/ -> eznotificationtransport.php (source)

   1  <?php
   2  //
   3  // Definition of eZNotificationTransport class
   4  //
   5  // Created on: <13-May-2003 12:01:34 sp>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file eznotificationtransport.php
  30  */
  31  
  32  /*!
  33    \class eZNotificationTransport eznotificationtransport.php
  34    \brief The class eZNotificationTransport does
  35  
  36  */
  37  include_once ( 'kernel/classes/notification/ezmailnotificationtransport.php' );
  38  class eZNotificationTransport
  39  {
  40      /*!
  41       Constructor
  42      */
  43      function eZNotificationTransport()
  44      {
  45      }
  46  
  47      function &instance( $transport = false, $forceNewInstance = false )
  48      {
  49          $ini =& eZINI::instance( 'notification.ini' );
  50          if ( $transport == false )
  51          {
  52              $transport = $ini->variable( 'TransportSettings', 'DefaultTransport' );
  53          }
  54          $transportImpl =& $GLOBALS['eZNotificationTransportGlobalInstance_' . $transport ];
  55          $class = get_class( $transportImpl );
  56  
  57          $fetchInstance = false;
  58          if ( !preg_match( '/.*?transport/', $class ) )
  59              $fetchInstance = true;
  60  
  61          if ( $forceNewInstance  )
  62          {
  63              $fetchInstance = true;
  64          }
  65  
  66          if ( $fetchInstance )
  67          {
  68              $extraPluginPathArray = $ini->variable( 'TransportSettings', 'TransportPluginPath' );
  69              $pluginPathArray = array_merge( array( 'kernel/classes/notification/' ),
  70                                              $extraPluginPathArray );
  71              foreach( $pluginPathArray as $pluginPath )
  72              {
  73                  $transportFile = $pluginPath . $transport . 'notificationtransport.php';
  74                  if ( file_exists( $transportFile ) )
  75                  {
  76                      include_once( $transportFile );
  77                      $className = $transport . 'notificationtransport';
  78                      $impl = new $className( );
  79                      break;
  80                  }
  81              }
  82          }
  83          if ( $impl === null )
  84          {
  85              $impl = new eZNotificationTransport();
  86              eZDebug::writeError( 'Transport implementation not supported: ' . $transport, 'eZNotificationTransport::instance' );
  87          }
  88          return $impl;
  89      }
  90  
  91      function send( $address = array(), $subject, $body, $transportData = null )
  92      {
  93          return true;
  94      }
  95  }
  96  
  97  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7