cvs: pear /SOAP Base.php Value.php

From: Date: Thu, 25 Jan 2007 23:29:18 +0000
Subject: cvs: pear /SOAP Base.php Value.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44386@lists.php.net to get a copy of this message
yunosh Thu Jan 25 23:29:18 2007 UTC Modified files: /pear/SOAP Base.php Value.php Log: One more global variable nuked. http://cvs.php.net/viewvc.cgi/pear/SOAP/Base.php?r1=1.75&r2=1.76&diff_format=u Index: pear/SOAP/Base.php diff -u pear/SOAP/Base.php:1.75 pear/SOAP/Base.php:1.76 --- pear/SOAP/Base.php:1.75 Thu Jan 25 23:17:52 2007 +++ pear/SOAP/Base.php Thu Jan 25 23:29:18 2007 @@ -24,23 +24,9 @@ * @link http://pear.php.net/package/SOAP */ +define('MAIL_MIMEPART_CRLF', "\r\n"); require_once 'PEAR.php'; -// optional features -$GLOBALS['SOAP_options'] = array(); - -@include_once 'Mail/mimePart.php'; -@include_once 'Mail/mimeDecode.php'; -if (class_exists('Mail_mimePart')) { - $GLOBALS['SOAP_options']['Mime'] = 1; - define('MAIL_MIMEPART_CRLF', "\r\n"); -} - -@include_once 'Net/DIME.php'; -if (class_exists('Net_DIME_Message')) { - $GLOBALS['SOAP_options']['DIME'] = 1; -} - /** * Enable debugging information? * @@ -968,10 +954,8 @@ function _makeMimeMessage(&$xml, $encoding = SOAP_DEFAULT_ENCODING) { - global $SOAP_options; - - if (!isset($SOAP_options['Mime'])) { - return $this->_raiseSoapFault('Mime is not installed'); + if (!@include_once 'Mail/mimePart.php') { + return $this->_raiseSoapFault('MIME messages are unsupported, the Mail_Mime package is not installed'); } // Encode any attachments. @@ -998,14 +982,12 @@ // TODO: this needs to be used from the Transport system. function _makeDIMEMessage($xml) { - global $SOAP_options; - - if (!isset($SOAP_options['DIME'])) { - return $this->_raiseSoapFault('DIME is not installed'); + if (!@include_once 'Net/DIME.php') { + return $this->_raiseSoapFault('DIME messages are unsupported, the Net_DIME package is not installed'); } - // Encode any attachments. - // See http://search.ietf.org/internet-drafts/draft-nielsen-dime-soap-00.txt + // Encode any attachments. See + // http://search.ietf.org/internet-drafts/draft-nielsen-dime-soap-00.txt // Now we have to DIME encode the message $dime =& new Net_DIME_Message(); $msg = $dime->encodeData($xml, SOAP_ENVELOP, null, NET_DIME_TYPE_URI); @@ -1026,11 +1008,8 @@ function _decodeMimeMessage(&$data, &$headers, &$attachments) { - global $SOAP_options; - - if (!isset($SOAP_options['Mime'])) { - $this->_raiseSoapFault('Mime Unsupported, install PEAR::Mail::Mime', '', '', 'Server'); - return; + if (!@include_once 'Mail/mimeDecode.php') { + return $this->_raiseSoapFault('MIME messages are unsupported, the Mail_Mime package is not installed'); } $params['include_bodies'] = true; @@ -1076,11 +1055,8 @@ function _decodeDIMEMessage(&$data, &$headers, &$attachments) { - global $SOAP_options; - - if (!isset($SOAP_options['DIME'])) { - $this->_raiseSoapFault('DIME Unsupported, install PEAR::Net::DIME', '', '', 'Server'); - return; + if (!@include_once 'Net/DIME.php') { + return $this->_raiseSoapFault('DIME messages are unsupported, the Net_DIME package is not installed'); } // This SHOULD be moved to the transport layer, e.g. PHP itself should http://cvs.php.net/viewvc.cgi/pear/SOAP/Value.php?r1=1.44&r2=1.45&diff_format=u Index: pear/SOAP/Value.php diff -u pear/SOAP/Value.php:1.44 pear/SOAP/Value.php:1.45 --- pear/SOAP/Value.php:1.44 Fri Jan 6 17:16:11 2006 +++ pear/SOAP/Value.php Thu Jan 25 23:29:18 2007 @@ -17,7 +17,7 @@ * @author Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more * @author Chuck Hagenbuch <chuck@horde.org> Maintenance * @author Jan Schneider <jan@horde.org> Maintenance - * @copyright 2003-2005 The PHP Group + * @copyright 2003-2007 The PHP Group * @license http://www.php.net/license/2_02.txt PHP License 2.02 * @link http://pear.php.net/package/SOAP */ @@ -189,11 +189,6 @@ { parent::SOAP_Value($name, null, null); - if (!isset($GLOBALS['SOAP_options']['Mime'])) { - $this->options['attachment'] = PEAR::raiseError('Mail_mime is not installed, unable to support SOAP Attachements'); - return; - } - $filedata = ($file === null) ? $this->_file2str($filename) : $file; $filename = basename($filename); if (PEAR::isError($filedata)) {

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