pozo / json-rpc-php Goto Github PK
View Code? Open in Web Editor NEWClient/Server library for PHP 5.2.6
Home Page: https://github.com/Pozo/json-rpc-php
Client/Server library for PHP 5.2.6
Home Page: https://github.com/Pozo/json-rpc-php
i try to modivied some script @ JsonRpcServer.class.php:
private function isValidRequestObjectId($requestId) {
if(is_string($resquestId))
$resquestId=(float)$resquestId;
if(is_null($requestId) OR is_int($requestId))
return true;
else
return false;
/return (is_null($requestId)
|| is_string($requestId)
// 2 and "2" is valid but 2.1 and "2.1" is not
|| (ctype_digit($requestId) xor is_int($requestId)));/
}
at your code, it will make mistake if $resquest id between 48 to 57. Because return from ctype_digit($requestId) will be true and is_int($requestId) is true. So, the return will be false because xor must not true each other.
In JsonRpcServer#183 call_user_func_array expects an array, but when using named parameters $requestObject->params is an object. Other than that, the parameters are correctly reordered via introspection, we just need to cast it to array.
private function call($methodOwnerService, $requestObject) {
$callbackFunction = array($methodOwnerService,$requestObject->method);
return call_user_func_array($callbackFunction, (array) $requestObject->params);
}
Is this project Open Source? If you don't add a license, it's not Open Source even if the code is public.
__autoload is discouraged because it's usually makes problems when using different frameworks which are all using the autoload feature.
It would be great to see this changed in this library!
I need to send associative array as parameter via json rpc
for example.
{"sendDate":"2013-07-06", "packageId":1}
But if i type like
$myExample->getContent(array('sendDate' => '2013-06-17', 'packageId' => 1));
the $params wil show
[{"sendDate":"2013-07-06", "packageId":1}]
So it not correct.
I think there must be a fix near here.
if (is_array($params)) {
// no keys
$params = array_values($params);
using array_pop instead of array_values work fine.
Please advise
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.