[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/ -> soap.php (source)

   1  <?php
   2  //
   3  // Created on: <11-Oct-2004 15:41:12 kk>
   4  //
   5  // SOFTWARE NAME: eZ publish
   6  // SOFTWARE RELEASE: 3.9.0
   7  // BUILD VERSION: 17785
   8  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
   9  // SOFTWARE LICENSE: GNU General Public License v2.0
  10  // NOTICE: >
  11  //   This program is free software; you can redistribute it and/or
  12  //   modify it under the terms of version 2.0  of the GNU General
  13  //   Public License as published by the Free Software Foundation.
  14  //
  15  //   This program is distributed in the hope that it will be useful,
  16  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  17  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18  //   GNU General Public License for more details.
  19  //
  20  //   You should have received a copy of version 2.0 of the GNU General
  21  //   Public License along with this program; if not, write to the Free
  22  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  23  //   MA 02110-1301, USA.
  24  //
  25  //
  26  
  27  /*! \file soap.php
  28  */
  29  
  30  /*!
  31    \brief The SOAP file will handle all eZ publish soap requests.
  32  
  33    SOAP functions are
  34  */
  35  
  36  ob_start();
  37  
  38  include_once ( "lib/ezutils/classes/ezdebug.php" );
  39  include_once ( "lib/ezutils/classes/ezini.php" );
  40  include_once ( 'lib/ezutils/classes/ezsys.php' );
  41  include_once ( 'lib/ezutils/classes/ezexecution.php' );
  42  
  43  /*!
  44   Reads settings from site.ini and passes them to eZDebug.
  45  */
  46  function eZUpdateDebugSettings()
  47  {
  48      $ini =& eZINI::instance();
  49  
  50      list( $debugSettings['debug-enabled'], $debugSettings['debug-by-ip'], $debugSettings['debug-by-user'], $debugSettings['debug-ip-list'], $debugSettings['debug-user-list'] ) =
  51          $ini->variableMulti( 'DebugSettings', array( 'DebugOutput', 'DebugByIP', 'DebugByUser', 'DebugIPList', 'DebugUserIDList' ), array ( 'enabled', 'enabled', 'enabled' ) );
  52      eZDebug::updateSettings( $debugSettings );
  53  }
  54  
  55  $ini =& eZINI::instance();
  56  
  57  // Initialize/set the index file.
  58  eZSys::init( 'soap.php', $ini->variable( 'SiteAccessSettings', 'ForceVirtualHost' ) == 'true' );
  59  eZSys::initIni( $ini );
  60  
  61  
  62  // include ezsession override implementation
  63  include_once ( "lib/ezutils/classes/ezsession.php" );
  64  
  65  // Check for extension
  66  include_once ( 'lib/ezutils/classes/ezextension.php' );
  67  include_once ( 'kernel/common/ezincludefunctions.php' );
  68  eZExtension::activateExtensions( 'default' );
  69  // Extension check end
  70  
  71  
  72  // Activate correct siteaccess
  73  include_once ( "access.php" );
  74  $access = array( 'name' => $ini->variable( 'SiteSettings', 'DefaultAccess' ),
  75                   'type' => EZ_ACCESS_TYPE_DEFAULT );
  76  $access = changeAccess( $access );
  77  $GLOBALS['eZCurrentAccess'] =& $access;
  78  // Siteaccess activation end
  79  
  80  // Check for activating Debug by user ID (Final checking. The first was in eZDebug::updateSettings())
  81  eZDebug::checkDebugByUser();
  82  
  83  /*!
  84   Reads settings from i18n.ini and passes them to eZTextCodec.
  85  */
  86  function eZUpdateTextCodecSettings()
  87  {
  88      $ini =& eZINI::instance( 'i18n.ini' );
  89  
  90      list( $i18nSettings['internal-charset'], $i18nSettings['http-charset'], $i18nSettings['mbstring-extension'] ) =
  91          $ini->variableMulti( 'CharacterSettings', array( 'Charset', 'HTTPCharset', 'MBStringExtension' ), array( false, false, 'enabled' ) );
  92  
  93      include_once ( 'lib/ezi18n/classes/eztextcodec.php' );
  94      eZTextCodec::updateSettings( $i18nSettings );
  95  }
  96  
  97  // Initialize text codec settings
  98  eZUpdateTextCodecSettings();
  99  
 100  include_once ( 'lib/ezdb/classes/ezdb.php' );
 101  $db =& eZDB::instance();
 102  
 103  // Initialize module loading
 104  include_once ( "lib/ezutils/classes/ezmodule.php" );
 105  
 106  $moduleINI =& eZINI::instance( 'module.ini' );
 107  $globalModuleRepositories = $moduleINI->variable( 'ModuleSettings', 'ModuleRepositories' );
 108  $extensionRepositories = $moduleINI->variable( 'ModuleSettings', 'ExtensionRepositories' );
 109  $extensionDirectory = eZExtension::baseDirectory();
 110  $activeExtensions = eZExtension::activeExtensions();
 111  $globalExtensionRepositories = array();
 112  foreach ( $extensionRepositories as $extensionRepository )
 113  {
 114      $extPath = $extensionDirectory . '/' . $extensionRepository;
 115      $modulePath = $extPath . '/modules';
 116      if ( file_exists( $modulePath ) )
 117      {
 118          $globalExtensionRepositories[] = $modulePath;
 119      }
 120      else if ( !file_exists( $extPath ) )
 121      {
 122          eZDebug::writeWarning( "Extension '$extensionRepository' was reported to have modules but the extension itself does not exist.\n" .
 123                                 "Check the setting ModuleSettings/ExtensionRepositories in module.ini for your extensions.\n" .
 124                                 "You should probably remove this extension from the list." );
 125      }
 126      else if ( !in_array( $extensionRepository, $activeExtensions ) )
 127      {
 128          eZDebug::writeWarning( "Extension '$extensionRepository' was reported to have modules but has not yet been activated.\n" .
 129                                 "Check the setting ModuleSettings/ExtensionRepositories in module.ini for your extensions\n" .
 130                                 "or make sure it is activated in the setting ExtensionSettings/ActiveExtensions in site.ini." );
 131      }
 132      else
 133      {
 134          eZDebug::writeWarning( "Extension '$extensionRepository' does not have the subdirectory 'modules' allthough it reported it had modules.\n" .
 135                                 "Looked for directory '" . $modulePath . "'\n" .
 136                                 "Check the setting ModuleSettings/ExtensionRepositories in module.ini for your extension." );
 137      }
 138  }
 139  $moduleRepositories = array_merge( $moduleRepositories, $globalModuleRepositories, $globalExtensionRepositories );
 140  eZModule::setGlobalPathList( $moduleRepositories );
 141  
 142  
 143  // Load soap extensions
 144  $soapINI =& eZINI::instance( 'soap.ini' );
 145  $enableSOAP = $soapINI->variable( 'GeneralSettings', 'EnableSOAP' );
 146  
 147  if ( $enableSOAP == 'true' )
 148  {
 149      eZSys::init( 'soap.php' );
 150  
 151      include_once ( 'kernel/classes/datatypes/ezuser/ezuser.php' );
 152  
 153      // Login if we have username and password.
 154      if ( isset( $_SERVER['PHP_AUTH_USER'] ) and isset( $_SERVER['PHP_AUTH_PW'] ) )
 155          eZUser::loginUser( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] );
 156  
 157      include_once ( 'lib/ezsoap/classes/ezsoapserver.php' );
 158  
 159      $server = new eZSOAPServer();
 160  
 161      foreach( $soapINI->variable( 'ExtensionSettings', 'SOAPExtensions' ) as $extension )
 162      {
 163          include_once( eZExtension::baseDirectory() . '/' . $extension . '/soap/initialize.php' );
 164      }
 165  
 166      $server->processRequest();
 167  }
 168  
 169  ob_end_flush();
 170  
 171  eZExecution::cleanExit();
 172  
 173  ?>


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