[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpgwapi/inc xml_functions.inc.php,1.28,1.29
From: |
Dan Kuykendall <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpgwapi/inc xml_functions.inc.php,1.28,1.29 |
Date: |
Sat, 10 May 2003 04:53:45 -0400 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv15386
Modified Files:
xml_functions.inc.php
Log Message:
wrapped a couple functions in if statements because they are now part of new
versions of PHP
Index: xml_functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/xml_functions.inc.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** xml_functions.inc.php 28 Sep 2002 20:01:44 -0000 1.28
--- xml_functions.inc.php 10 May 2003 08:53:43 -0000 1.29
***************
*** 471,503 ****
* author: Dan Libby (address@hidden) *
****************************************************************/
! function xmlrpc_decode($xmlrpc_val)
{
! $kind = @$xmlrpc_val->kindOf();
!
! if($kind == 'scalar')
! {
! return $xmlrpc_val->scalarval();
! }
! elseif($kind == 'array')
{
! $size = $xmlrpc_val->arraysize();
! $arr = array();
! for($i = 0; $i < $size; $i++)
{
! $arr[]=xmlrpc_decode($xmlrpc_val->arraymem($i));
}
! return $arr;
! }
! elseif($kind == 'struct')
! {
! $xmlrpc_val->structreset();
! $arr = array();
!
! while(list($key,$value)=$xmlrpc_val->structeach())
{
! $arr[$key] = xmlrpc_decode($value);
}
- return $arr;
}
}
--- 471,506 ----
* author: Dan Libby (address@hidden) *
****************************************************************/
! if (!function_exists('xmlrpc_decode'))
{
! function xmlrpc_decode($xmlrpc_val, $encoding = '')
{
! $kind = @$xmlrpc_val->kindOf();
! if($kind == 'scalar')
{
! return $xmlrpc_val->scalarval();
}
! elseif($kind == 'array')
! {
! $size = $xmlrpc_val->arraysize();
! $arr = array();
!
! for($i = 0; $i < $size; $i++)
! {
!
$arr[]=xmlrpc_decode($xmlrpc_val->arraymem($i));
! }
! return $arr;
! }
! elseif($kind == 'struct')
{
! $xmlrpc_val->structreset();
! $arr = array();
!
!
while(list($key,$value)=$xmlrpc_val->structeach())
! {
! $arr[$key] = xmlrpc_decode($value);
! }
! return $arr;
}
}
}
***************
*** 515,555 ****
* author: Dan Libby (address@hidden) *
****************************************************************/
! function xmlrpc_encode($php_val)
{
! $type = gettype($php_val);
! $xmlrpc_val = CreateObject('phpgwapi.xmlrpcval');
!
! switch($type)
{
! case 'array':
! case 'object':
! $arr = array();
! while (list($k,$v) = each($php_val))
! {
! $arr[$k] = xmlrpc_encode($v);
! }
! $xmlrpc_val->addStruct($arr);
! break;
! case 'integer':
! $xmlrpc_val->addScalar($php_val, xmlrpcInt);
! break;
! case 'double':
! $xmlrpc_val->addScalar($php_val, xmlrpcDouble);
! break;
! case 'string':
! $xmlrpc_val->addScalar($php_val, xmlrpcString);
! break;
! // <G_Giunta_2001-02-29>
! // Add support for encoding/decoding of booleans, since
they are supported in PHP
! case 'boolean':
! $xmlrpc_val->addScalar($php_val, xmlrpcBoolean);
! break;
! // </G_Giunta_2001-02-29>
! case 'unknown type':
! default:
! $xmlrpc_val = false;
! break;
}
- return $xmlrpc_val;
}
--- 518,561 ----
* author: Dan Libby (address@hidden) *
****************************************************************/
! if (!function_exists('xmlrpc_encode'))
{
! function xmlrpc_encode($php_val)
{
! $type = gettype($php_val);
! $xmlrpc_val = CreateObject('phpgwapi.xmlrpcval');
!
! switch($type)
! {
! case 'array':
! case 'object':
! $arr = array();
! while (list($k,$v) = each($php_val))
! {
! $arr[$k] = xmlrpc_encode($v);
! }
! $xmlrpc_val->addStruct($arr);
! break;
! case 'integer':
! $xmlrpc_val->addScalar($php_val,
xmlrpcInt);
! break;
! case 'double':
! $xmlrpc_val->addScalar($php_val,
xmlrpcDouble);
! break;
! case 'string':
! $xmlrpc_val->addScalar($php_val,
xmlrpcString);
! break;
! // <G_Giunta_2001-02-29>
! // Add support for encoding/decoding of
booleans, since they are supported in PHP
! case 'boolean':
! $xmlrpc_val->addScalar($php_val,
xmlrpcBoolean);
! break;
! // </G_Giunta_2001-02-29>
! case 'unknown type':
! default:
! $xmlrpc_val = false;
! break;
! }
! return $xmlrpc_val;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpgwapi/inc xml_functions.inc.php,1.28,1.29,
Dan Kuykendall <address@hidden> <=