meatoff/upchain

There is no license information available for the latest version (dev-master) of this package.

Installs: 6

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/meatoff/upchain

dev-master 2017-06-10 12:20 UTC

This package is not auto-updated.

Last update: 2025-09-28 01:12:13 UTC


README

Upchain-php is modern protocol for communication with microservices through cluster.

Install

$ composer require meatoff/upchain

Create Service

require_once '../vendor/autoload.php';

use meatoff\upchain\HttpAdapter;
use meatoff\upchain\Service;

$service = new Service(HttpAdapter::class);

$service->input("auth", function ($input, $payload) {
    if($input['email'] == 'email@email.com' && $input['password'] == 'password') {
        $payload['auth_token'] = bin2hex(random_bytes(16));
        $payload['user_id'] = 534;
    }
    return $payload;
});

$service->serve();

Create Cluster

For cluster creation you can use upchain-js.