{"id":17309681,"url":"https://github.com/jcubic/json-rpc","last_synced_at":"2025-04-14T13:52:49.599Z","repository":{"id":2212791,"uuid":"3162113","full_name":"jcubic/json-rpc","owner":"jcubic","description":"JSON-RPC implementaion in php and JavaScript","archived":false,"fork":false,"pushed_at":"2021-11-24T08:42:40.000Z","size":40,"stargazers_count":13,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T02:53:25.409Z","etag":null,"topics":["javascript","json","json-rpc","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcubic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-12T12:54:26.000Z","updated_at":"2022-11-25T18:39:58.000Z","dependencies_parsed_at":"2022-08-19T18:50:07.203Z","dependency_job_id":null,"html_url":"https://github.com/jcubic/json-rpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcubic%2Fjson-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcubic%2Fjson-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcubic%2Fjson-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcubic%2Fjson-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcubic","download_url":"https://codeload.github.com/jcubic/json-rpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248891359,"owners_count":21178620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","json","json-rpc","php"],"created_at":"2024-10-15T12:31:32.452Z","updated_at":"2025-04-14T13:52:49.573Z","avatar_url":"https://github.com/jcubic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## [Server and Client implementaion of JSON-RPC (php \u003c=\u003e javascript)](https://github.com/jcubic/json-rpc/)\n\nThis is JSON-RPC implementaion, server in php and client in javascript\nbased on [version 1.1 of the Specification][1]\n\n## Server\n\n```php\n\u003c?php\nrequire('json-rpc.php');\n\nclass Foo {\n    function ping($str) {\n        return \"pong '$str'\";\n    }\n}\n\nhandle_json_rpc(new Foo());\n\n?\u003e\n```\n\n\n## Client\n\n```javascript\nrpc({\n    url: \"foo.php\",\n    error: function(error) {\n        alert(error.message);\n    },\n    // errorOnAbort: true,\n    debug: function(json, which) {\n        console.log(which + ': ' + JSON.stringify(json));\n    }\n})(function(foo) {\n    // now here you can access methods from Foo class\n    foo.ping(\"Hello\")(function(response) {\n        alert(response);\n    });\n});\n```\n\nif you prefer to use promises, you can use option `promisify: true`:\n\n```javascript\nrpc({\n    url: 'servce.php'.\n    promisify: true\n}).then(function(service) {\n    service.ping(\"hello\").then(function(response) {\n       alert(resonse);\n    });\n});\n```\n\n## Requirement\n\n* mbstring php module\n\n## License\n\nReleased under the [MIT license][2]\u003cbr/\u003e\nCopyright (c) 2011-2021 [Jakub T. Jankiewicz][3]\n\n\n[1]: http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html \"JSON-RPC 1.1 Specification\"\n[2]: https://opensource.org/licenses/MIT \"The MIT License (MIT)\"\n[3]: https://jcubic.pl/me \"Jakub T. Jankiewicz\"\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcubic%2Fjson-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcubic%2Fjson-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcubic%2Fjson-rpc/lists"}