cvs: pear /XML_RPC RPC.php package.xml

From: Date: Mon, 21 Feb 2005 21:49:15 +0000
Subject: cvs: pear /XML_RPC RPC.php package.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-29642@lists.php.net to get a copy of this message
danielc Mon Feb 21 16:49:15 2005 EDT Modified files: /pear/XML_RPC RPC.php package.xml Log: * Add the setSendEncoding() method and $send_encoding property to XML_RPC_Message. Request 3537. http://cvs.php.net/diff.php/pear/XML_RPC/RPC.php?r1=1.57&r2=1.58&ty=u Index: pear/XML_RPC/RPC.php diff -u pear/XML_RPC/RPC.php:1.57 pear/XML_RPC/RPC.php:1.58 --- pear/XML_RPC/RPC.php:1.57 Tue Jan 25 12:19:49 2005 +++ pear/XML_RPC/RPC.php Mon Feb 21 16:49:14 2005 @@ -32,7 +32,7 @@ * @author Martin Jansen <mj@php.net> * @author Daniel Convissor <danielc@php.net> * @copyright 1999-2001 Edd Dumbill - * @version CVS: $Id: RPC.php,v 1.57 2005/01/25 17:19:49 danielc Exp $ + * @version CVS: $Id: RPC.php,v 1.58 2005/02/21 21:49:14 danielc Exp $ * @link http://pear.php.net/package/XML_RPC */ @@ -154,7 +154,7 @@ /** - * Default XML encoding + * Default XML encoding (ISO-8859-1, UTF-8 or US-ASCII) * @global string $GLOBALS['XML_RPC_defencoding'] */ $GLOBALS['XML_RPC_defencoding'] = 'UTF-8'; @@ -947,6 +947,7 @@ * @author Edd Dumbill <edd@usefulinc.com> * @author Stig Bakken <stig@php.net> * @author Martin Jansen <mj@php.net> + * @author Daniel Convissor <danielc@php.net> * @copyright 1999-2001 Edd Dumbill * @version Release: @package_version@ * @link http://pear.php.net/package/XML_RPC @@ -954,10 +955,21 @@ class XML_RPC_Message extends XML_RPC_Base { /** - * The XML message being generated + * The current debug mode (1 = on, 0 = off) + * @var integer + */ + var $debug = 0; + + /** + * The encoding to be used for outgoing messages + * + * Defaults to the value of <var>$GLOBALS['XML_RPC_defencoding']</var> + * * @var string + * @see XML_RPC_Message::setSendEncoding(), + * $GLOBALS['XML_RPC_defencoding'], XML_RPC_Message::xml_header() */ - var $payload = ''; + var $send_encoding = ''; /** * The method presently being evaluated @@ -971,10 +983,10 @@ var $params = array(); /** - * The current debug mode (1 = on, 0 = off) - * @var integer + * The XML message being generated + * @var string */ - var $debug = 0; + var $payload = ''; /** * @return void @@ -990,11 +1002,25 @@ } /** + * Produces the XML declaration including the encoding attribute + * + * The encoding is determined by this class' <var>$send_encoding</var> + * property. If the <var>$send_encoding</var> property is not set, use + * <var>$GLOBALS['XML_RPC_defencoding']</var>. + * * @return string the XML declaration and <methodCall> element + * + * @see XML_RPC_Message::setSendEncoding(), + * XML_RPC_Message::$send_encoding, $GLOBALS['XML_RPC_defencoding'] */ function xml_header() { - return "<?xml version=\"1.0\"?>\n<methodCall>\n"; + global $XML_RPC_defencoding; + if (!$this->send_encoding) { + $this->send_encoding = $XML_RPC_defencoding; + } + return '<?xml version="1.0" encoding="' . $this->send_encoding . '"?>' + . "\n<methodCall>\n"; } /** @@ -1007,6 +1033,8 @@ /** * @return void + * + * @uses XML_RPC_Message::xml_header(), XML_RPC_Message::xml_footer() */ function createPayload() { @@ -1067,6 +1095,21 @@ } /** + * Sets the XML declaration's encoding attribute + * + * @param string $type the encoding type (ISO-8859-1, UTF-8 or US-ASCII) + * + * @return void + * + * @see XML_RPC_Message::$send_encoding, XML_RPC_Message::xml_header() + * @since Method available since Release 1.2.0 + */ + function setSendEncoding($type) + { + $this->send_encoding = $type; + } + + /** * Determine the XML's encoding via the encoding attribute * in the XML declaration * http://cvs.php.net/diff.php/pear/XML_RPC/package.xml?r1=1.36&r2=1.37&ty=u Index: pear/XML_RPC/package.xml diff -u pear/XML_RPC/package.xml:1.36 pear/XML_RPC/package.xml:1.37 --- pear/XML_RPC/package.xml:1.36 Tue Feb 8 11:20:01 2005 +++ pear/XML_RPC/package.xml Mon Feb 21 16:49:14 2005 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0"> <package version="1.0"> - <!-- $Id: package.xml,v 1.36 2005/02/08 16:20:01 danielc Exp $ --> + <!-- $Id: package.xml,v 1.37 2005/02/21 21:49:14 danielc Exp $ --> <name>XML_RPC</name> <summary>PHP implementation of the XML-RPC protocol</summary> <description> @@ -25,13 +25,13 @@ </maintainer> </maintainers> - <release> - <version>1.2.0RC6</version> - <date>2005-01-25</date> + <version>1.2.0RC7</version> + <date>2005-02-21</date> <state>beta</state> <notes><![CDATA[ -- Don't put the protocol in the Host field of the POST data. (danielc) +- Add the setSendEncoding() method and $send_encoding + property to XML_RPC_Message. Request 3537. ]]></notes> <filelist> <file role="php" name="RPC.php" baseinstalldir="XML"> @@ -56,6 +56,15 @@ <changelog> <release> + <version>1.2.0RC6</version> + <date>2005-01-25</date> + <state>beta</state> + <notes><![CDATA[ +- Don't put the protocol in the Host field of the POST data. (danielc) + ]]></notes> + </release> + + <release> <version>1.2.0RC5</version> <date>2005-01-24</date> <state>beta</state>

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