PHPackages                             mmplayer/jsonrpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mmplayer/jsonrpc

ActiveLibrary[API Development](/categories/api)

mmplayer/jsonrpc
================

A simple JSON-RPC client and server for Yii2 application

08PHP

Since Oct 26Pushed 10y ago2 watchersCompare

[ Source](https://github.com/mmplayer/yii2-php-json-rpc)[ Packagist](https://packagist.org/packages/mmplayer/jsonrpc)[ RSS](/packages/mmplayer-jsonrpc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Tutorials
=========

[](#tutorials)

[Guide using with Yii2](https://github.com/michalliu/php-json-rpc/wiki/Using-with-Yii2)

PHP JSON-RPC
============

[](#php-json-rpc)

PHP JSON-RPC is a simple JSON-RPC client and server. It is currently in an alpha state, a stable version is expected soon. Word of warning, API will probably change soon as well :)

[![Build Status](https://camo.githubusercontent.com/9467f4932e19729269916069ff8ae31501e555643676e536d5ddae3e456ae5aa/68747470733a2f2f7472617669732d63692e6f72672f3366732f7068702d6a736f6e2d7270632e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/3fs/php-json-rpc)

Installation
------------

[](#installation)

### Composer

[](#composer)

Simply add a dependency on `trifs/phpjsonrpc` to your project's `composer.json` file if you use [Composer](http://getcomposer.org/) to manage the dependencies of your project. Here is a minimal example of a `composer.json`:

```
{
    "require": {
        "trifs/jsonrpc": "dev-master"
    }
}
```

For a system-wide installation via Composer, you can run:

```
composer global require 'trifs/phpjsonrpc=*'
```

Usage Examples
--------------

[](#usage-examples)

### Client (single request)

[](#client-single-request)

```
$client = new trifs\jsonrpc\Client('http://example.com');
$client->request('method-one')
    ->send();

$client = new trifs\jsonrpc\Client('http://example.com');
$client->notification('method-one')
    ->send();
```

### Client (batch request)

[](#client-batch-request)

```
$client = new trifs\jsonrpc\Client('http://example.com');
$client->request('method-one')
    ->request('method-two')
    ->notification('method-three')
    ->send();
```

### Server

[](#server)

```
$input   = file_get_contents('php://input');
$invoker = function($method, array $params = []) {
    return time();
};

$server = new trifs\jsonrpc\Server($input, $invoker);
$server->run();
```

Contributing
------------

[](#contributing)

Contributions are always welcome. You make our lives easier by sending us your contributions through GitHub pull requests.

Due to time constraints, we are not always able to respond as quickly as we would like. Please do not take delays personal and feel free to remind us here if you feel that we forgot to respond.

### Using PHP JSON-RPC in a development environment

[](#using-php-json-rpc-in-a-development-environment)

To set PHP JSON-RPC up locally, make sure to have [Vagrant](http://vagrantup.com) and [VirtualBox](http://virtualbox.org) installed.

```
git clone git://github.com/3fs/php-json-rpc
cd php-json-rpc
vagrant up
```

After making the changes, run `./build/qa.sh all`, sit back and relax. If there are problems reported, repeat. If not, try harder :)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a3467b0ec9df615e9a706878b2ee2e7a38b4cf8e81f5fa003b27c0fa053a3d5?d=identicon)[mmplayer](/maintainers/mmplayer)

---

Top Contributors

[![michalliu](https://avatars.githubusercontent.com/u/1010851?v=4)](https://github.com/michalliu "michalliu (16 commits)")[![davidkuridza](https://avatars.githubusercontent.com/u/953796?v=4)](https://github.com/davidkuridza "davidkuridza (14 commits)")[![mmplayer](https://avatars.githubusercontent.com/u/442269?v=4)](https://github.com/mmplayer "mmplayer (1 commits)")

### Embed Badge

![Health badge](/badges/mmplayer-jsonrpc/health.svg)

```
[![Health](https://phpackages.com/badges/mmplayer-jsonrpc/health.svg)](https://phpackages.com/packages/mmplayer-jsonrpc)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
