{"id":13828500,"url":"https://github.com/datto/php-json-rpc","last_synced_at":"2025-04-04T17:09:17.921Z","repository":{"id":32500141,"uuid":"36080865","full_name":"datto/php-json-rpc","owner":"datto","description":"Fully unit-tested JSON-RPC 2.0 for PHP","archived":false,"fork":false,"pushed_at":"2020-03-29T19:48:23.000Z","size":69,"stargazers_count":186,"open_issues_count":4,"forks_count":42,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-28T16:09:45.818Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-22T15:51:33.000Z","updated_at":"2025-03-24T13:28:42.000Z","dependencies_parsed_at":"2022-09-01T10:40:54.213Z","dependency_job_id":null,"html_url":"https://github.com/datto/php-json-rpc","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fphp-json-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fphp-json-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fphp-json-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datto%2Fphp-json-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datto","download_url":"https://codeload.github.com/datto/php-json-rpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217221,"owners_count":20903009,"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":[],"created_at":"2024-08-04T09:02:49.559Z","updated_at":"2025-04-04T17:09:17.905Z","avatar_url":"https://github.com/datto.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# JSON-RPC for PHP\n\n\n## Overview\n\nThis package allows you to create and evaluate JSON-RPC messages, using your own\nPHP code to evaluate the requests.\n\nThis package allows you to create and evaluate any JSON-RPC message. It\nimplements the JSON-RPC specifications, but does *not* provide a transport\nlayer—which you'll also need if you want to send or receive messages over a\ndistance! One of the beautiful features of JSON-RPC is that you can use *any*\ntransport layer to carry your messages: This package gives you that option.\n\nIf you're looking for an end-to-end solution, with the transport layer included,\nthen you should use one of these alternative packages instead:\n* To send messages over HTTP(S), use the\n[php-json-rpc-http](https://github.com/datto/php-json-rpc-http) package.\n* To send messages over SSH, use the\n[php-json-rpc-ssh](https://github.com/datto/php-json-rpc-ssh) package.\n\n\n## Features\n\n* Correct: fully compliant with the [JSON-RPC 2.0 specifications](http://www.jsonrpc.org/specification) (100% unit-test coverage)\n* Flexible: you can use your own code to evaluate the JSON-RPC method strings\n* Minimalistic: extremely lightweight\n* Ready to use, with working examples\n\n\n## Examples\n\n### Client\n\n```php\n$client = new Client();\n\n$client-\u003equery(1, 'add', array(1, 2));\n\n$message = $client-\u003eencode();\n\n// message: {\"jsonrpc\":\"2.0\",\"method\":\"add\",\"params\":[1,2],\"id\":1}\n```\n\n### Server\n\n```php\n$api = new Api();\n\n$server = new Server($api);\n\n$reply = $server-\u003ereply($message);\n\n// reply: {\"jsonrpc\":\"2.0\",\"result\":3,\"id\":1}\n```\n\n*See the [examples](https://github.com/datto/php-json-rpc/tree/master/examples) folder for full working examples.*\n\n\n## Requirements\n\n* PHP \u003e= 7.0\n\n\n## License\n\nThis package is released under an open-source license: [LGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.html)\n\n\n## Installation\n\nIf you're using [Composer](https://getcomposer.org/), you can include this library\n([datto/json-rpc](https://packagist.org/packages/datto/json-rpc)) like this:\n```\ncomposer require \"datto/json-rpc\"\n```\n\n\n## Getting started\n\n1. Try the examples. You can run the examples from the project directory like this:\n\t```\n\tphp examples/client.php\n\tphp examples/server.php\n\t```\n\n2. Take a look at the code \"examples/src\"—then replace it with your own!\n\n\n## Unit tests\n\nYou can run the suite of unit tests from the project directory like this:\n```\n./vendor/bin/phpunit\n```\n\n\n## Changelog\n\nSee what has changed:\n[Changelog](https://github.com/datto/php-json-rpc/blob/master/CHANGELOG.md)\n\n\n## Author\n\n[Spencer Mortensen](http://spencermortensen.com/contact/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatto%2Fphp-json-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatto%2Fphp-json-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatto%2Fphp-json-rpc/lists"}