johnstevenson / jsonrpc Goto Github PK
View Code? Open in Web Editor NEWA JSON-RPC implementation for PHP
License: MIT License
A JSON-RPC implementation for PHP
License: MIT License
Hello,
I have latest code and php5.3-unbuntu.
Warning: date(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for 'IST/5.0/no DST' instead in /var/www/jsonrpc/example/client.php on line 41 Call Stack: 0.0001 328420 1. {main}() /var/www/jsonrpc/example/client.php:0 0.0113 369792 2. date() /var/www/jsonrpc/example/client.php:41
I have set at top date_default_timezone_set('America/Los_Angeles');
I getting this and script not works.
Thanks,
Tejas Tank.
[email protected]
I'd like to log the output of json rpc server.
however,
https://github.com/johnstevenson/jsonrpc/blob/master/src/JsonRpc/Transport/BasicServer.php#L16
prints to standard output so the caller of this jsonrpc cannot log the output.
Do you have any idea or could you change the architecture more flexible?
Does it also works with javascript jsonrpc request?
Please let me know which library you tested for javascript !
Parameters are ordered by name, but optional parameters not present in request are not handled and the parameters are shifted.
With the function :
updateUser($password = null, $email = null, $receiveEmail = null)
request :
"params":{"receiveEmail":false, "email":"[email protected]"}
bad call :
updateUser("[email protected]", false)
The server ordered well the parameters, but miss the first optional one and call the function with the list receive.
Anyway, thanks for this great bundle,
Vincent.
jsonrpc appears to be PSR compliant so I think that the error/exception logging should be PSR compliant too with the Logger Interface.
All that's necessary is to call the log
method as per \Psr\Log\LoggerInterface
instead of addRecord
. The parameters are the same.
See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md for more information.
Hello,
From web client I had make request, but server understand array as object.
How can I set json_decode($string, true);
My Client request .
$.jsonrpc({
method : 'finalprice',
params : {mod:'invoice',ids:[1], vals:{'name':"tejas tank"}},
debug : true
}, {
success : function(result) {
console.log(result,"d");
},
error : function(error) {
console.log(error,"error");
},
});
Here, Json server understand {'name':"tejas tank"} as an object instead of array.
I getting error log, PHP Warning: Invalid argument supplied for foreach() in /var/www/tejas.php on line 2165
Because of I pass {'name':"tejas tank"} and it should be understand as array.
Please let me know your response soon.
Thanks,
tejas tank.
gtalk : [email protected]
Does any jasonrpc.js support for your jsonserver ?
Can you add some flexible and easy examples.
Examples with different kind of data from server to client and client to server.
Example hold int, float, Date, array, char, text. in call and response.
I have faced many time date related issues in rpc server and clients.
I want to use this with my application.
If you provide soon examples then I will be really thankful of you.
Thanks,
Tejas
I would like to ask why you want to use file_get_content this inefficient way, instead of using curl
If we have a lot of parameters and want to validate them via some framework validators, it could be useful to let users to pass params to method as a variadic param. e.g.
public function methodName(...$params)
{
// some validations here
}
Seems like there is an issue with the response class, all my calls show this error: Invalid Response (0): Missing member: jsonrpc
.
Made some test and it seems to come from Response
class that thinks it is an old Response
, if I change the following code in Client
class:
if (!$res = $response->create($json_array))
{
$this->setError($response->fault);
}
To this:
if (!$res = $response->create((array)$json_array))
{
$this->setError($response->fault);
}
It works fine, here is my raw response:
{"result":{"transactions":[],"lastblock":"673e1f84afefafea446f2dd9c942ac7f387f5f46089933829fbf759652e95e69"},"error":null,"id":1}
Korri
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.