PHPackages                             greplab/jsonrpcsmd - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. greplab/jsonrpcsmd

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

greplab/jsonrpcsmd
==================

Classes to build a map of the services available using the JSON-RPC SMD specification (http://www.simple-is-better.org/json-rpc/jsonrpc20-smd.html).

v0.2.1(11y ago)0421MITPHPPHP &gt;=5.0.0

Since Oct 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/dzegarra/jsonrpcsmd)[ Packagist](https://packagist.org/packages/greplab/jsonrpcsmd)[ Docs](https://github.com/GrepLab/jsonrpcsmd)[ RSS](/packages/greplab-jsonrpcsmd/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (1)

JSON-RPC Service Mapping Description builder
--------------------------------------------

[](#json-rpc-service-mapping-description-builder)

This library make a reflection of the classes given and output a json using the v2 of the [proposal specification published in simple-is-better.org](http://www.simple-is-better.org/json-rpc/jsonrpc20-smd.html).

### Usage

[](#usage)

To start use this library just create an instance of the Smb class. This class is the core of the library. You only need work this Smb. The Smb class only need to know the url of the endpoint witch is where the calls will be sended. You can pass the url in the constructor or set later using the setTarget() method. But remember, you cannot generate the json map if the target is not setted.

```
//You can start like this:
$smd = new \Greplab\Jsonrpcsmd\Smd('http://my-website/path/of/the/endpoint');

//Or like that:
$smd = new \Greplab\Jsonrpcsmd\Smd();
$smd->setTarget('http://my-website/path/of/the/endpoint');

```

#### Canonical URL

[](#canonical-url)

If the "canonical" option is enabled each method will have a diferent endpoint consisting in the default endpoint url plus the name of the service and method. This is useful when you use a tool like firebug to monitor the ajax calls. This way each call is easily recognizable but require the server recognize and identify this last seccion as the service and method path. This option is disabled by default.

To change this use: $smd-&gt;setUseCanonical(true);

#### Add classes

[](#add-classes)

To index a class simple execute:

```
$smd->addClass('ClassNameToIndex');

```

You have to call this method for each class you want to index.

#### Build the json map

[](#build-the-json-map)

To get the json map just print the Smd instance to the browser. If you want the json before to send the browser use the toJson() method.

```
$json = $smd->toJson();
print($json);

```

### License

[](#license)

This library is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~23 days

Total

5

Last Release

4135d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4b73935d763e0a8701d4c80fefb3283428f61c78e5b71f4cd7324c6f0b9a7ae?d=identicon)[dzegarra](/maintainers/dzegarra)

---

Top Contributors

[![dzegarra](https://avatars.githubusercontent.com/u/651286?v=4)](https://github.com/dzegarra "dzegarra (1 commits)")

---

Tags

jsonrpcservicemappingjsonrpcdescriptionjson-rpcsmd

### Embed Badge

![Health badge](/badges/greplab-jsonrpcsmd/health.svg)

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

###  Alternatives

[datto/json-rpc

Fully unit-tested JSON-RPC 2.0 for PHP

1951.3M14](/packages/datto-json-rpc)[hprose/hprose

It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system.

2.1k215.3k37](/packages/hprose-hprose)[wa72/jsonrpc-bundle

JSON-RPC server for Symfony: exposes services registered in the service container as JSON-RPC webservices

3164.1k](/packages/wa72-jsonrpc-bundle)[cranetm/yii2-json-rpc-2.0

JSON RPC 2.0 for Yii2 strict type validation of request and response data

2679.6k1](/packages/cranetm-yii2-json-rpc-20)[graze/guzzle-jsonrpc

JSON-RPC 2.0 client for Guzzle

981.2M24](/packages/graze-guzzle-jsonrpc)[datto/json-rpc-http

HTTP client and server for JSON-RPC 2.0

66525.9k5](/packages/datto-json-rpc-http)

PHPackages © 2026

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