cvs: pear /SOAP Base.php Client.php

From: Date: Sun, 18 Aug 2002 18:45:48 +0000
Subject: cvs: pear /SOAP Base.php Client.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5794@lists.php.net to get a copy of this message
shane Sun Aug 18 14:45:48 2002 EDT Modified files: /pear/SOAP Base.php Client.php Log: get rid of some duplicate code globalize some config vars, helps make soap work if included inside a class Index: pear/SOAP/Base.php diff -u pear/SOAP/Base.php:1.21 pear/SOAP/Base.php:1.22 --- pear/SOAP/Base.php:1.21 Sat Aug 17 14:55:29 2002 +++ pear/SOAP/Base.php Sun Aug 18 14:45:48 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: Base.php,v 1.21 2002/08/17 18:55:29 shane Exp $ +// $Id: Base.php,v 1.22 2002/08/18 18:45:48 shane Exp $ // /* @@ -25,14 +25,14 @@ rather than arrays. This has been done to provide a closer match to php-soap. If the old behaviour is needed, set to false. The old behaviour is depricated. */ -$SOAP_OBJECT_STRUCT = TRUE; +$GLOBALS['SOAP_OBJECT_STRUCT'] = TRUE; /* SOAP_RAW_CONVERT makes pear::soap attempt to determine what SOAP type a php string COULD be. This may result in slightly better interoperability when you are not using WSDL, and are being lazy and not using SOAP_Value to define types for your values. */ -$SOAP_RAW_CONVERT = FALSE; +$GLOBALS['SOAP_RAW_CONVERT'] = FALSE; require_once 'PEAR.php'; #require_once 'SOAP/Fault.php'; @@ -40,28 +40,28 @@ require_once 'SOAP/Type/hexBinary.php'; // optional features -$SOAP_options = array(); +$GLOBALS['SOAP_options'] = array(); @include_once 'Mail/mimePart.php'; @include_once 'Mail/mimeDecode.php'; if (class_exists('Mail_mimePart')) { - $SOAP_options['Mime'] = 1; + $GLOBALS['SOAP_options']['Mime'] = 1; define('MAIL_MIMEPART_CRLF',"\n"); } @include_once 'Net/DIME.php'; if (class_exists('Net_DIME_Message')) { - $SOAP_options['DIME'] = 1; + $GLOBALS['SOAP_options']['DIME'] = 1; } -#error_reporting(E_ALL & ~E_NOTICE); +error_reporting(E_ALL); /** * Enable debugging informations? * * @const SOAP_DEBUG */ -define('SOAP_DEBUG', false); +$GLOBALS['SOAP_DEBUG']=false; if (!function_exists('version_compare') || version_compare(phpversion(), '4.1', '<')) { @@ -112,7 +112,7 @@ * Common base class of all Soap lclasses * * @access public -* @version $Id: Base.php,v 1.21 2002/08/17 18:55:29 shane Exp $ +* @version $Id: Base.php,v 1.22 2002/08/18 18:45:48 shane Exp $ * @package SOAP::Client * @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates */ @@ -204,7 +204,7 @@ * @var boolean if true debugging informations will be store in $debug_data * @see $debug_data, SOAP_Base */ - var $debug_flag = SOAP_DEBUG; + var $debug_flag = false; /** * String containing debugging informations if $debug_flag is set to true @@ -253,6 +253,7 @@ { $this->myfaultcode = $faultcode; $this->resetNamespaces(); + $this->debug_flag = $GLOBALS['SOAP_DEBUG']; parent::PEAR('SOAP_Fault'); } @@ -310,14 +311,12 @@ $this->fault = $str; } else { if (!$code) $code = $this->myfaultcode; - $this->fault = $this->raiseError($str, - $code, - $mode, - $options, - $detail, - 'SOAP_Fault', - $skipmsg); - $this->fault->error_message_prefix = $actorURI; + $this->fault = new SOAP_Fault($str, + $code, + $actorURI, + $detail, + $mode, + $options); } return $this->fault; } @@ -919,7 +918,7 @@ * class used to handle QNAME values in XML * * @access public -* @version $Id: Base.php,v 1.21 2002/08/17 18:55:29 shane Exp $ +* @version $Id: Base.php,v 1.22 2002/08/18 18:45:48 shane Exp $ * @package SOAP::Client * @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates */ Index: pear/SOAP/Client.php diff -u pear/SOAP/Client.php:1.39 pear/SOAP/Client.php:1.40 --- pear/SOAP/Client.php:1.39 Fri Aug 16 22:38:35 2002 +++ pear/SOAP/Client.php Sun Aug 18 14:45:48 2002 @@ -17,7 +17,7 @@ // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author | // +----------------------------------------------------------------------+ // -// $Id: Client.php,v 1.39 2002/08/17 02:38:35 shane Exp $ +// $Id: Client.php,v 1.40 2002/08/18 18:45:48 shane Exp $ // require_once 'SOAP/Value.php'; @@ -37,7 +37,7 @@ * originaly based on SOAPx4 by Dietrich Ayala http://dietrich.ganx4.com/soapx4 * * @access public -* @version $Id: Client.php,v 1.39 2002/08/17 02:38:35 shane Exp $ +* @version $Id: Client.php,v 1.40 2002/08/18 18:45:48 shane Exp $ * @package SOAP::Client * @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates * @author Stig Bakken <ssb@fast.no> Conversion to PEAR @@ -433,23 +433,9 @@ return $this->raiseSoapFault($returnArray); } if (is_object($returnArray)) { - $vars = get_object_vars($returnArray); - if (array_key_exists('faultcode',$vars) || array_key_exists('Fault',$vars)) { - $faultcode = $faultstring = $faultdetail = $faultactor = ''; - foreach ($returnArray as $k => $v) { - if (stristr($k,'faultcode')) $faultcode = $v; - if (stristr($k,'faultstring')) $faultstring = $v; - if (stristr($k,'detail')) $faultdetail = $v; - if (stristr($k,'faultactor')) $faultactor = $v; - } - return $this->raiseSoapFault($faultstring, $faultdetail, $faultactor, $faultcode); - } - if (count($vars) == 1) { - return array_shift($vars); - } - // multiple return arguments! - return $vars; - } else + $returnArray = get_object_vars($returnArray); + } + if (is_array($returnArray)) { if (isset($returnArray['faultcode']) || isset($returnArray['SOAP-ENV:faultcode'])) { $faultcode = $faultstring = $faultdetail = $faultactor = '';

« previous php.pear.cvs (#5794) next »