git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f62d1ad
)
Support i8 type
author
Tuxity
<kevin.darcel@gmail.com>
Tue, 14 Jun 2016 17:57:45 +0000
(12:57 -0500)
committer
Tuxity
<kevin.darcel@gmail.com>
Tue, 14 Jun 2016 17:57:45 +0000
(12:57 -0500)
doc/manual/phpxmlrpc_manual.adoc
patch
|
blob
|
history
lib/xmlrpc_wrappers.inc
patch
|
blob
|
history
src/Helper/XMLParser.php
patch
|
blob
|
history
src/Server.php
patch
|
blob
|
history
src/Value.php
patch
|
blob
|
history
src/Wrapper.php
patch
|
blob
|
history
diff --git
a/doc/manual/phpxmlrpc_manual.adoc
b/doc/manual/phpxmlrpc_manual.adoc
index
8943600
..
50af655
100644
(file)
--- a/
doc/manual/phpxmlrpc_manual.adoc
+++ b/
doc/manual/phpxmlrpc_manual.adoc
@@
-220,9
+220,9
@@
If you've benefited from the effort that has been put into writing this software
===== int
===== int
-The type i4
is
accepted as a synonym
+The type i4
and i8 are
accepted as a synonym
for int when creating xmlrpcval objects. The
for int when creating xmlrpcval objects. The
- xml parsing code will always convert i4 to
+ xml parsing code will always convert i4
and i8
to
int: int is regarded
by this implementation as the canonical name for this type.
int: int is regarded
by this implementation as the canonical name for this type.
@@
-890,7
+890,7
@@
$xmlrpcerruser800The minimum value for errors reported by user
reserved for library usage.
reserved for library usage.
-==== $xmlrpcI4, $xmlrpcInt, $xmlrpcBoolean, $xmlrpcDouble, $xmlrpcString, $xmlrpcDateTime, $xmlrpcBase64, $xmlrpcArray, $xmlrpcStruct, $xmlrpcValue, $xmlrpcNull
+==== $xmlrpcI4, $xmlrpcI
8 $xmlrpcI
nt, $xmlrpcBoolean, $xmlrpcDouble, $xmlrpcString, $xmlrpcDateTime, $xmlrpcBase64, $xmlrpcArray, $xmlrpcStruct, $xmlrpcValue, $xmlrpcNull
For convenience the strings representing the XML-RPC types have
been encoded as global variables:
For convenience the strings representing the XML-RPC types have
been encoded as global variables:
@@
-898,6
+898,7
@@
For convenience the strings representing the XML-RPC types have
----
$xmlrpcI4="i4";
----
$xmlrpcI4="i4";
+$xmlrpcI8="i8";
$xmlrpcInt="int";
$xmlrpcBoolean="boolean";
$xmlrpcDouble="double";
$xmlrpcInt="int";
$xmlrpcBoolean="boolean";
$xmlrpcDouble="double";
diff --git
a/lib/xmlrpc_wrappers.inc
b/lib/xmlrpc_wrappers.inc
index
3c2390a
..
cec3374
100644
(file)
--- a/
lib/xmlrpc_wrappers.inc
+++ b/
lib/xmlrpc_wrappers.inc
@@
-172,7
+172,7
@@
function build_remote_method_wrapper_code($client, $methodName, $xmlrpcFuncName,
for ($i = 1; $i < $pCount; $i++) {
$plist[] = "\$p$i";
$pType = $mSig[$i];
for ($i = 1; $i < $pCount; $i++) {
$plist[] = "\$p$i";
$pType = $mSig[$i];
- if ($pType == 'i4' || $pType == 'int' || $pType == 'boolean' || $pType == 'double' ||
+ if ($pType == 'i4' || $pType == 'i
8' || $pType == 'i
nt' || $pType == 'boolean' || $pType == 'double' ||
$pType == 'string' || $pType == 'dateTime.iso8601' || $pType == 'base64' || $pType == 'null'
) {
// only build directly xmlrpc values when type is known and scalar
$pType == 'string' || $pType == 'dateTime.iso8601' || $pType == 'base64' || $pType == 'null'
) {
// only build directly xmlrpc values when type is known and scalar
diff --git
a/src/Helper/XMLParser.php
b/src/Helper/XMLParser.php
index
d5c7176
..
b4798cc
100644
(file)
--- a/
src/Helper/XMLParser.php
+++ b/
src/Helper/XMLParser.php
@@
-40,6
+40,7
@@
class XMLParser
'VALUE' => array('MEMBER', 'DATA', 'PARAM', 'FAULT'),
'BOOLEAN' => array('VALUE'),
'I4' => array('VALUE'),
'VALUE' => array('MEMBER', 'DATA', 'PARAM', 'FAULT'),
'BOOLEAN' => array('VALUE'),
'I4' => array('VALUE'),
+ 'I8' => array('VALUE'),
'INT' => array('VALUE'),
'STRING' => array('VALUE'),
'DOUBLE' => array('VALUE'),
'INT' => array('VALUE'),
'STRING' => array('VALUE'),
'DOUBLE' => array('VALUE'),
@@
-101,6
+102,7
@@
class XMLParser
$this->_xh['php_class'] = null;
break;
case 'I4':
$this->_xh['php_class'] = null;
break;
case 'I4':
+ case 'I8':
case 'INT':
case 'STRING':
case 'BOOLEAN':
case 'INT':
case 'STRING':
case 'BOOLEAN':
@@
-259,6
+261,7
@@
class XMLParser
break;
case 'BOOLEAN':
case 'I4':
break;
case 'BOOLEAN':
case 'I4':
+ case 'I8':
case 'INT':
case 'STRING':
case 'DOUBLE':
case 'INT':
case 'STRING':
case 'DOUBLE':
diff --git
a/src/Server.php
b/src/Server.php
index
382630e
..
a0e0cb1
100644
(file)
--- a/
src/Server.php
+++ b/
src/Server.php
@@
-335,7
+335,7
@@
class Server
$pt = $p->kindOf();
}
} else {
$pt = $p->kindOf();
}
} else {
- $pt =
$in[$n] == 'i4'
? 'int' : strtolower($in[$n]); // dispatch maps never use i4...
+ $pt =
($in[$n] == 'i4' || $in[$n] == 'i8')
? 'int' : strtolower($in[$n]); // dispatch maps never use i4...
}
// param index is $n+1, as first member of sig is return type
}
// param index is $n+1, as first member of sig is return type
diff --git
a/src/Value.php
b/src/Value.php
index
385d92b
..
d48f0b8
100644
(file)
--- a/
src/Value.php
+++ b/
src/Value.php
@@
-10,6
+10,7
@@
use PhpXmlRpc\Helper\Charset;
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
{
public static $xmlrpcI4 = "i4";
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
{
public static $xmlrpcI4 = "i4";
+ public static $xmlrpcI8 = "i8";
public static $xmlrpcInt = "int";
public static $xmlrpcBoolean = "boolean";
public static $xmlrpcDouble = "double";
public static $xmlrpcInt = "int";
public static $xmlrpcBoolean = "boolean";
public static $xmlrpcDouble = "double";
@@
-23,6
+24,7
@@
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
public static $xmlrpcTypes = array(
"i4" => 1,
public static $xmlrpcTypes = array(
"i4" => 1,
+ "i8" => 1,
"int" => 1,
"boolean" => 1,
"double" => 1,
"int" => 1,
"boolean" => 1,
"double" => 1,
@@
-61,6
+63,7
@@
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
$this->me['string'] = $val;
break;
case 'i4':
$this->me['string'] = $val;
break;
case 'i4':
+ case 'i8':
case 'int':
case 'double':
case 'string':
case 'int':
case 'double':
case 'string':
@@
-93,7
+96,7
@@
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
* Fails if the xmlrpc value is not an array and already initialized.
*
* @param mixed $val
* Fails if the xmlrpc value is not an array and already initialized.
*
* @param mixed $val
- * @param string $type allowed values: i4, int, boolean, string, double, dateTime.iso8601, base64, null.
+ * @param string $type allowed values: i4, i
8, i
nt, boolean, string, double, dateTime.iso8601, base64, null.
*
* @return int 1 or 0 on failure
*/
*
* @return int 1 or 0 on failure
*/
@@
-249,6
+252,7
@@
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
break;
case static::$xmlrpcInt:
case static::$xmlrpcI4:
break;
case static::$xmlrpcInt:
case static::$xmlrpcI4:
+ case static::$xmlrpcI8:
$rs .= "<${typ}>" . (int)$val . "</${typ}>";
break;
case static::$xmlrpcDouble:
$rs .= "<${typ}>" . (int)$val . "</${typ}>";
break;
case static::$xmlrpcDouble:
@@
-403,7
+407,7
@@
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
/**
* Returns the type of the xmlrpc value.
*
/**
* Returns the type of the xmlrpc value.
*
- * For integers, 'int' is always returned in place of 'i4'.
+ * For integers, 'int' is always returned in place of 'i4'
or 'i8'
.
*
* @return string
*/
*
* @return string
*/
@@
-411,7
+415,7
@@
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
{
reset($this->me);
list($a,) = each($this->me);
{
reset($this->me);
list($a,) = each($this->me);
- if ($a == static::$xmlrpcI4) {
+ if ($a == static::$xmlrpcI4
|| $a == static::$xmlrpcI8
) {
$a = static::$xmlrpcInt;
}
$a = static::$xmlrpcInt;
}
@@
-524,7
+528,7
@@
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
}
return;
case 1:
}
return;
case 1:
-// todo: handle i4 vs int
+// todo: handle i4
/i8
vs int
reset($this->me);
list($type,) = each($this->me);
if ($type != $offset) {
reset($this->me);
list($type,) = each($this->me);
if ($type != $offset) {
@@
-545,7
+549,7
@@
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
case 2:
return isset($this->me['array'][$offset]);
case 1:
case 2:
return isset($this->me['array'][$offset]);
case 1:
-// todo: handle i4 vs int
+// todo: handle i4
/i8
vs int
return $offset == $this->scalartyp();
default:
return false;
return $offset == $this->scalartyp();
default:
return false;
@@
-584,4
+588,4
@@
class Value implements \Countable, \IteratorAggregate, \ArrayAccess
throw new \Exception("XML-RPC Value is of type 'undef' and can not be accessed using array index");
}
}
throw new \Exception("XML-RPC Value is of type 'undef' and can not be accessed using array index");
}
}
-}
\ No newline at end of file
+}
diff --git
a/src/Wrapper.php
b/src/Wrapper.php
index
8ea8f2d
..
ce12d9a
100644
(file)
--- a/
src/Wrapper.php
+++ b/
src/Wrapper.php
@@
-41,6
+41,7
@@
class Wrapper
case 'integer':
case Value::$xmlrpcInt: // 'int'
case Value::$xmlrpcI4:
case 'integer':
case Value::$xmlrpcInt: // 'int'
case Value::$xmlrpcI4:
+ case Value::$xmlrpcI8:
return Value::$xmlrpcInt;
case Value::$xmlrpcDouble: // 'double'
return Value::$xmlrpcDouble;
return Value::$xmlrpcInt;
case Value::$xmlrpcDouble: // 'double'
return Value::$xmlrpcDouble;
@@
-84,6
+85,7
@@
class Wrapper
return Value::$xmlrpcString;
case 'int':
case 'i4':
return Value::$xmlrpcString;
case 'int':
case 'i4':
+ case 'i8':
return 'integer';
case 'struct':
case 'array':
return 'integer';
case 'struct':
case 'array':
@@
-836,7
+838,7
@@
class Wrapper
break;
}
$pType = $mSig[$i+1];
break;
}
$pType = $mSig[$i+1];
- if ($pType == 'i4' || $pType == 'int' || $pType == 'boolean' || $pType == 'double' ||
+ if ($pType == 'i4' || $pType == 'i
8' || $pType == 'i
nt' || $pType == 'boolean' || $pType == 'double' ||
$pType == 'string' || $pType == 'dateTime.iso8601' || $pType == 'base64' || $pType == 'null'
) {
// by building directly xmlrpc values when type is known and scalar (instead of encode() calls),
$pType == 'string' || $pType == 'dateTime.iso8601' || $pType == 'base64' || $pType == 'null'
) {
// by building directly xmlrpc values when type is known and scalar (instead of encode() calls),
@@
-925,7
+927,7
@@
class Wrapper
for ($i = 1; $i < $pCount; $i++) {
$plist[] = "\$p$i";
$pType = $mSig[$i];
for ($i = 1; $i < $pCount; $i++) {
$plist[] = "\$p$i";
$pType = $mSig[$i];
- if ($pType == 'i4' || $pType == 'int' || $pType == 'boolean' || $pType == 'double' ||
+ if ($pType == 'i4' || $pType == 'i
8' || $pType == 'i
nt' || $pType == 'boolean' || $pType == 'double' ||
$pType == 'string' || $pType == 'dateTime.iso8601' || $pType == 'base64' || $pType == 'null'
) {
// only build directly xmlrpc values when type is known and scalar
$pType == 'string' || $pType == 'dateTime.iso8601' || $pType == 'base64' || $pType == 'null'
) {
// only build directly xmlrpc values when type is known and scalar