PHPackages                             wxbacy/yarsign - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wxbacy/yarsign

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wxbacy/yarsign
==============

The sign library for yar

v1.0(5y ago)03.5kMITPHPPHP &gt;=5.4

Since Aug 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/wxbacy/yarsign)[ Packagist](https://packagist.org/packages/wxbacy/yarsign)[ RSS](/packages/wxbacy-yarsign/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

> The sign library for yar, make your service more safe which used yar

Requirement
-----------

[](#requirement)

PHP 5.4+ and YAR extension installed

Get Started
-----------

[](#get-started)

### Install via composer

[](#install-via-composer)

Add Yarsign to composer.json configuration file.

```
$ composer require wxbacy/yarsign

```

```
// If you installed via composer, just use this code to requrie autoloader on the top of your projects.
require 'vendor/autoload.php';

// Using Yarsign namespace
use Yarsign\Conf;
use Yarsign\Client;

// Initialize
Conf::load([
    'user' => [
        'service_address' => 'http://userservice.com/rpc/index',
        'secret' => '1532YADJas',
    ],
    'mall' => [
        'service_address' => 'http://mallservice.com/rpc/index',
        'secret' => '1532YADJas',
    ],
]);

// Server

// 以下写在控制器
$serviceStr = $_GET['service'];
$ts = $_GET['ts'];
$sign = $_GET['sign'];

// 解密
$service = Sign::serviceDecode($serviceStr);

// 身份认证
if (! Sign::checkSign($service['service'], $service['class'], $ts, $sign)) {
    return;
}

$server = new Yar_Server(new $service['class']());
$server->handle();

// Client
$userModel = Client::getInstance('user', 'UserModel');
$userModel->getUserByUserid(156562);

$userDetail = [];
Client::concurrentCall('user', 'UserModel', 'getUserByUserid', [156562], function($retval, $callinfo) use (&$userDetail){
    if ($callinfo == NULL) {
        return true;
    }
    $userDetail['username'] = $retval['username'];
    $userDetail['gender'] = $retval['gender'];
});

Client::concurrentCall('user', 'UserModel', 'getUserAccount', [156562], function($retval, $callinfo) use (&$userDetail){
    if ($callinfo == NULL) {
        return true;
    }
    $userDetail['balance_lyb'] = $retval['balance_lyb'];
    $userDetail['balance_mb'] = $retval['balance_mb'];
});

Yar_Concurrent_Client::loop();
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

2097d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/543156cbc2efb77fe0e566c570240f1e0707bdf996a58562284536e7f8a7ef7c?d=identicon)[wxbacy](/maintainers/wxbacy)

---

Top Contributors

[![wxbacy](https://avatars.githubusercontent.com/u/20201380?v=4)](https://github.com/wxbacy "wxbacy (10 commits)")

---

Tags

phprpcsignyar

### Embed Badge

![Health badge](/badges/wxbacy-yarsign/health.svg)

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

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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